本文整理汇总了C#中ISymbolDocument类的典型用法代码示例。如果您正苦于以下问题:C# ISymbolDocument类的具体用法?C# ISymbolDocument怎么用?C# ISymbolDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISymbolDocument类属于命名空间,在下文中一共展示了ISymbolDocument类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Generate
public SequencePoint[] Generate(ISymbolMethod method)
{
var sequencePoints = new List<SequencePoint>();
var sp_count = method.SequencePointCount;
var spOffsets = new int[sp_count]; // Array.CreateInstance(int, sp_count)
var spDocs = new ISymbolDocument[sp_count]; // Array.CreateInstance(ISymbolDocument, sp_count)
var spStartLines = new int[sp_count]; // Array.CreateInstance(int, sp_count)
var spEndLines = new int[sp_count]; // Array.CreateInstance(int, sp_count)
var spStartCol = new int[sp_count]; // Array.CreateInstance(int, sp_count)
var spEndCol = new int[sp_count]; // Array.CreateInstance(int, sp_count)
method.GetSequencePoints(spOffsets, spDocs, spStartLines, spStartCol, spEndLines, spEndCol);
for (int i = 0; i < sp_count; i++) // (var i in range(sp_count))
{
if (spStartLines[i] != 0xfeefee) // if spStartLines[i] != 0xfeefee:
{
sequencePoints.Add(new SequencePoint(spOffsets[i],
spDocs[i],
spStartLines[i],
spStartCol[i],
spEndLines[i],
spEndCol[i]));
}
}
return sequencePoints.ToArray();
}
开发者ID:acken,项目名称:ClrSequencer,代码行数:27,代码来源:SequencePointFactory.cs
示例2: ArgumentException
void ISymbolMethod.GetSequencePoints(int[] offsets, ISymbolDocument[] documents, int[] lines, int[] columns,
int[] endLines, int[] endColumns) {
int count = Lines == null ? 0 : Lines.Count;
if (offsets != null && offsets.Length != count)
throw new ArgumentException("Invalid array length: offsets");
if (documents != null && documents.Length != count)
throw new ArgumentException("Invalid array length: documents");
if (lines != null && lines.Length != count)
throw new ArgumentException("Invalid array length: lines");
if (columns != null && columns.Length != count)
throw new ArgumentException("Invalid array length: columns");
if (endLines != null && endLines.Length != count)
throw new ArgumentException("Invalid array length: endLines");
if (endColumns != null && endColumns.Length != count)
throw new ArgumentException("Invalid array length: endColumns");
if (count <= 0)
return;
int i = 0;
foreach (var line in Lines) {
offsets[i] = (int)line.Offset;
documents[i] = line.Document;
lines[i] = (int)line.LineBegin;
columns[i] = (int)line.ColumnBegin;
endLines[i] = (int)line.LineEnd;
endColumns[i] = (int)line.ColumnEnd;
i++;
}
}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:30,代码来源:DbiFunction.cs
示例3: GetSequencePoints
public void GetSequencePoints(int[] offsets, ISymbolDocument[] documents, int[] lines, int[] columns, int[] endLines, int[] endColumns) {
// Any array can be null, and the documentation says we must verify the sizes.
int arySize = -1;
if (offsets != null) arySize = offsets.Length;
else if (documents != null) arySize = documents.Length;
else if (lines != null) arySize = lines.Length;
else if (columns != null) arySize = columns.Length;
else if (endLines != null) arySize = endLines.Length;
else if (endColumns != null)arySize = endColumns.Length;
if (offsets != null && offsets.Length != arySize) throw new ArgumentException("Invalid array length: offsets");
if (documents != null && documents.Length != arySize) throw new ArgumentException("Invalid array length: documents");
if (lines != null && lines.Length != arySize) throw new ArgumentException("Invalid array length: lines");
if (columns != null && columns.Length != arySize) throw new ArgumentException("Invalid array length: columns");
if (endLines != null && endLines.Length != arySize) throw new ArgumentException("Invalid array length: endLines");
if (endColumns != null && endColumns.Length != arySize) throw new ArgumentException("Invalid array length: endColumns");
if (arySize <= 0)
return;
var unDocs = documents == null ? null : new ISymUnmanagedDocument[documents.Length];
uint size;
method.GetSequencePoints((uint)arySize, out size, offsets, unDocs, lines, columns, endLines, endColumns);
if (unDocs != null) {
for (int i = 0; i < unDocs.Length; i++)
documents[i] = unDocs[i] == null ? null : new SymbolDocument(unDocs[i]);
}
}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:30,代码来源:SymbolMethod.cs
示例4: GetOffset
public int GetOffset(ISymbolDocument document, int line, int column) {
var symDoc = document as SymbolDocument;
if (symDoc == null)
throw new ArgumentException("document is not a non-null SymbolDocument instance");
uint result;
method.GetOffset(symDoc.SymUnmanagedDocument, (uint)line, (uint)column, out result);
return (int)result;
}
开发者ID:KitoHo,项目名称:Reflexil,代码行数:8,代码来源:SymbolMethod.cs
示例5: SequencePoint
// Constructor.
public SequencePoint(int offset, ISymbolDocument document,
int line, int column)
{
this.offset = offset;
this.document = document;
this.line = line;
this.column = column;
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:9,代码来源:SymMethod.cs
示例6: SequencePoint
public SequencePoint(int offset, ISymbolDocument document, int lineStart, int lineStartColumn, int lineEnd, int lineEndColumn)
{
Offset = offset;
Document = document;
LineStart = lineStart;
LineStartColumn = lineStartColumn;
LineEnd = lineEnd;
LineEndColumn = lineEndColumn;
}
开发者ID:acken,项目名称:ClrSequencer,代码行数:9,代码来源:SequencePoint.cs
示例7: SourceDocument
internal SourceDocument(string[] lines, string location, ISymbolDocument symbols)
{
this.Lines = lines;
this.Content = string.Join(Environment.NewLine, lines);
this.Location = location;
this.Symbols = symbols;
}
开发者ID:ashmind,项目名称:ashmind-code,代码行数:9,代码来源:SourceDocument.cs
示例8: SequencePoint
public SequencePoint(int offset, ISymbolDocument document, int startLine, int startColumn, int endLine,
int endColumn)
{
this.offset = offset;
this.document = document;
this.startLine = startLine;
this.startColumn = startColumn;
this.endLine = endLine;
this.endColumn = endColumn;
}
开发者ID:asengupta,项目名称:DllDbg,代码行数:10,代码来源:SequencePoint.cs
示例9: PdbDocument
/// <summary>
/// Constructor
/// </summary>
/// <param name="symDoc">A <see cref="ISymbolDocument"/> instance</param>
public PdbDocument(ISymbolDocument symDoc) {
if (symDoc == null)
throw new ArgumentNullException("symDoc");
this.Url = symDoc.URL;
this.Language = symDoc.Language;
this.LanguageVendor = symDoc.LanguageVendor;
this.DocumentType = symDoc.DocumentType;
this.CheckSumAlgorithmId = symDoc.CheckSumAlgorithmId;
this.CheckSum = symDoc.GetCheckSum();
}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:14,代码来源:PdbDocument.cs
示例10: GetRanges
public int[] GetRanges(ISymbolDocument document, int line, int column) {
var symDoc = document as SymbolDocument;
if (symDoc == null)
throw new ArgumentException("document is not a non-null SymbolDocument instance");
uint arySize;
method.GetRanges(symDoc.SymUnmanagedDocument, (uint)line, (uint)column, 0, out arySize, null);
var ary = new int[arySize];
method.GetRanges(symDoc.SymUnmanagedDocument, (uint)line, (uint)column, (uint)ary.Length, out arySize, ary);
return ary;
}
开发者ID:KitoHo,项目名称:Reflexil,代码行数:10,代码来源:SymbolMethod.cs
示例11: GetOrLoadContent
private SourceDocument GetOrLoadContent(ISymbolDocument symbols)
{
var location = symbols.URL;
if (!File.Exists(location))
return null;
return documentCache.Get(
location, () => new SourceDocument(File.ReadAllLines(location), location, symbols)
);
}
开发者ID:ashmind,项目名称:ashmind-code,代码行数:10,代码来源:SourceProvider.cs
示例12: GetDocuments
public ISymbolDocument[] GetDocuments() {
uint numDocs;
reader.GetDocuments(0, out numDocs, null);
var unDocs = new ISymUnmanagedDocument[numDocs];
reader.GetDocuments((uint)unDocs.Length, out numDocs, unDocs);
var docs = new ISymbolDocument[numDocs];
for (uint i = 0; i < numDocs; i++)
docs[i] = new SymbolDocument(unDocs[i]);
return docs;
}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:10,代码来源:SymbolReader.cs
示例13: GetMethodFromDocumentPosition
public ISymbolMethod GetMethodFromDocumentPosition(ISymbolDocument document, int line, int column) {
var symDoc = document as SymbolDocument;
if (symDoc == null)
throw new ArgumentException("document is not a non-null SymbolDocument instance");
ISymUnmanagedMethod unMethod;
int hr = reader.GetMethodFromDocumentPosition(symDoc.SymUnmanagedDocument, (uint)line, (uint)column, out unMethod);
if (hr == E_FAIL)
return null;
Marshal.ThrowExceptionForHR(hr);
return unMethod == null ? null : new SymbolMethod(unMethod);
}
开发者ID:EmilZhou,项目名称:dnlib,代码行数:11,代码来源:SymbolReader.cs
示例14: attemptSetBreakpoint
private bool attemptSetBreakpoint(ISymbolReader reader, ISymbolDocument doc, CorModule module)
{
if (!doc.URL.Equals(_breakpoint.File))
return false;
var line = doc.FindClosestLine(_breakpoint.Line);
var method = reader.GetMethodFromDocumentPosition(doc, line, _breakpoint.Column);
var function = module.GetFunctionFromToken(method.Token.GetToken());
var wasSet = attemptToSetBreakpointThroughSequencePoints(doc, line, method, function);
if (!wasSet)
setBreakpointThroughFunction(function);
return true;
}
开发者ID:acken,项目名称:ClrSequencer,代码行数:14,代码来源:BreakpointSetter.cs
示例15: attemptToSetBreakpointThroughSequencePoints
private bool attemptToSetBreakpointThroughSequencePoints(ISymbolDocument doc, int line, ISymbolMethod method, CorFunction function)
{
bool found = false;
foreach (var sp in getSequencePoints(method))
{
if (sp.Document.URL.Equals(doc.URL) && sp.LineStart.Equals(line))
{
var bp = function.ILCode.CreateBreakpoint(sp.Offset);
bp.Activate(true);
found = true;
break;
}
}
return found;
}
开发者ID:acken,项目名称:ClrSequencer,代码行数:15,代码来源:BreakpointSetter.cs
示例16: GetSequencePoints
public static SequencePoint[] GetSequencePoints(this ISymbolMethod method)
{
var offsets = new int[method.SequencePointCount];
var documents = new ISymbolDocument[method.SequencePointCount];
var lines = new int[method.SequencePointCount];
var columns = new int[method.SequencePointCount];
var endLines = new int[method.SequencePointCount];
var endColumns = new int[method.SequencePointCount];
var sequencePoints = new SequencePoint[method.SequencePointCount];
method.GetSequencePoints(offsets, documents, lines, columns, endLines, endColumns);
for (int i = 0; i < method.SequencePointCount; i++)
{
var location = new SourceLocation(documents[i].URL, lines[i], columns[i], endLines[i], endColumns[i]);
sequencePoints[i] = new SequencePoint(offsets[i], location);
}
return sequencePoints;
}
开发者ID:Novakov,项目名称:HighLevelCodeAnalysis,代码行数:21,代码来源:Extensions.cs
示例17: GetSequencePoints
//private string[] GetCombinedSource(IEnumerable<SequencePoint> points) {
// var lines = new List<string>();
// foreach (var point in points) {
// var contentLines = documentCache.Get(point.Document, () => File.ReadAllLines(point.Document.URL));
// var start = point.Start.Row - 1;
// var end = point.End.Row - 1;
// if (start >= contentLines.Length || end >= contentLines.Length)
// continue;
// for (var i = start; i <= end; i++) {
// var line = contentLines[i];
// if (i == start)
// line = line.Substring(point.Start.Column - 1);
// else if (i == end)
// line = line.Substring(0, point.End.Column - 1);
// lines.Add(line);
// }
// }
// return lines.ToArray();
//}
private IEnumerable<SequencePoint> GetSequencePoints(ISymbolMethod method)
{
var count = method.SequencePointCount;
var offsets = new int[count];
var docs = new ISymbolDocument[count];
var startColumns = new int[count];
var endColumns = new int[count];
var startRows = new int[count];
var endRows = new int[count];
method.GetSequencePoints(offsets, docs, startRows, startColumns, endRows, endColumns);
for (int i = 0; i < count; i++) {
if (startRows[i] == SequencePointHiddenLine || endRows[i] == SequencePointHiddenLine)
continue;
yield return new SequencePoint {
Document = this.GetOrLoadContent(docs[i]),
Start = new SourcePosition(startRows[i], startColumns[i]),
End = new SourcePosition(endRows[i], endColumns[i])
};
}
}
开发者ID:ashmind,项目名称:ashmind-code,代码行数:43,代码来源:SourceProvider.cs
示例18: MethodDebugInfo
public MethodDebugInfo(MethodBody body, ISymbolMethod pdb)
{
Body = body;
// todo. support multiple locals sharing the same local slot
// (but having different Start::End offsets, of course)
// so far we just silently ignore them taking into account only the first one
var locals = pdb.RootScope.Flatten(ss => ss.GetChildren()).SelectMany(ss => ss.GetLocals());
LocalNames = locals.Select(lv => new {Index = lv.AddressField1, Name = lv.Name})
.Distinct().ToDictionary(lv => lv.Index, lv => lv.Name).ToReadOnly();
var count = pdb.SequencePointCount;
var offsets = new int[count];
var documents = new ISymbolDocument[count];
var lines = new int[count];
var columns = new int[count];
var endLines = new int[count];
var endColumns = new int[count];
pdb.GetSequencePoints(offsets, documents, lines, columns, endLines, endColumns);
SequencePoints = 0.UpTo(count - 1).Select(i =>
new SequencePoint(offsets[i], documents[i], lines[i], columns[i], endLines[i], endColumns[i])
).ToReadOnly();
}
开发者ID:xeno-by,项目名称:truesight-lite,代码行数:24,代码来源:MethodDebugInfo.cs
示例19: GetSourceStartEnd
public bool GetSourceStartEnd(ISymbolDocument[] docs,
int[] lines,
int[] columns)
{
uint i;
bool pRetVal = false;
int spCount = 0;
if (docs != null)
spCount = docs.Length;
else if (lines != null)
spCount = lines.Length;
else if (columns != null)
spCount = columns.Length;
// If we don't have at least 2 entries then return an error
if (spCount < 2)
throw new ArgumentException();
// Make sure all arrays are the same length.
if ((docs != null) && (spCount != docs.Length))
throw new ArgumentException();
if ((lines != null) && (spCount != lines.Length))
throw new ArgumentException();
if ((columns != null) && (spCount != columns.Length))
throw new ArgumentException();
var unmanagedDocuments = new ISymUnmanagedDocument[docs.Length];
m_unmanagedMethod.GetSourceStartEnd(unmanagedDocuments, lines, columns, out pRetVal);
if (pRetVal)
{
for (i = 0; i < docs.Length; i++)
{
docs[i] = new SymbolDocument(unmanagedDocuments[i]);
}
}
return pRetVal;
}
开发者ID:o2platform,项目名称:O2.Platform.Projects.Misc_and_Legacy,代码行数:39,代码来源:symmethod.cs
示例20:
public virtual void GetSequencePoints
(int[] offsets, ISymbolDocument[] documents,
int[] lines, int[] columns, int[] endLines,
int[] endColumns)
{
int index;
LoadSequencePoints();
for(index = 0; index < sequencePoints.Count; ++index)
{
if(offsets != null && index < offsets.Length)
{
offsets[index] =
((SequencePoint)(sequencePoints[index])).offset;
}
if(documents != null && index < documents.Length)
{
documents[index] =
((SequencePoint)(sequencePoints[index])).document;
}
if(lines != null && index < lines.Length)
{
lines[index] =
((SequencePoint)(sequencePoints[index])).line;
}
if(columns != null && index < columns.Length)
{
columns[index] =
((SequencePoint)(sequencePoints[index])).column;
}
if(endLines != null && index < endLines.Length)
{
// This information is not available.
endLines[index] = 0;
}
if(endColumns != null && index < endColumns.Length)
{
// This information is not available.
endColumns[index] = 0;
}
}
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:41,代码来源:SymMethod.cs
注:本文中的ISymbolDocument类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论