本文整理汇总了C#中Mono.CompilerServices.SymbolWriter.MethodEntry类的典型用法代码示例。如果您正苦于以下问题:C# MethodEntry类的具体用法?C# MethodEntry怎么用?C# MethodEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MethodEntry类属于Mono.CompilerServices.SymbolWriter命名空间,在下文中一共展示了MethodEntry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ReadLocalVariables
void ReadLocalVariables (MethodEntry entry, MethodBody body)
{
LocalVariableEntry[] locals = entry.GetLocals ();
foreach (LocalVariableEntry loc in locals) {
VariableDefinition var = body.Variables [loc.Index];
var.Name = loc.Name;
Scope scope = m_scopes [loc.BlockIndex] as Scope;
if (scope == null)
continue;
scope.Variables.Add (var);
}
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:13,代码来源:MdbReader.cs
示例2: ReadLineNumbers
void ReadLineNumbers (MethodEntry entry, IDictionary instructions)
{
LineNumberTable lnt = entry.GetLineNumberTable ();
foreach (LineNumberEntry line in lnt.LineNumbers) {
Instruction instr = instructions [line.Offset] as Instruction;
if (instr == null)
continue;
Document doc = GetDocument (entry.CompileUnit.SourceFile);
instr.SequencePoint = new SequencePoint (doc);
instr.SequencePoint.StartLine = line.Row;
instr.SequencePoint.EndLine = line.Row;
}
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:14,代码来源:MdbReader.cs
示例3: MethodEntry
internal MethodEntry(MonoSymbolFile file, CompileUnitEntry comp_unit, int token, ScopeVariable[] scope_vars, LocalVariableEntry[] locals, LineNumberEntry[] lines, CodeBlockEntry[] code_blocks, string real_name, MethodEntry.Flags flags, int namespace_id)
{
this.SymbolFile = file;
this.real_name = real_name;
this.locals = locals;
this.code_blocks = code_blocks;
this.scope_vars = scope_vars;
this.flags = flags;
this.index = -1;
this.Token = token;
this.CompileUnitIndex = comp_unit.Index;
this.CompileUnit = comp_unit;
this.NamespaceID = namespace_id;
this.CheckLineNumberTable(lines);
this.lnt = new LineNumberTable(file, lines);
file.NumLineNumbers += lines.Length;
int num_locals = (locals != null) ? locals.Length : 0;
if (num_locals <= 32)
{
for (int i = 0; i < num_locals; i++)
{
string nm = locals[i].Name;
for (int j = i + 1; j < num_locals; j++)
{
if (locals[j].Name == nm)
{
flags |= MethodEntry.Flags.LocalNamesAmbiguous;
goto IL_108;
}
}
}
IL_108:;
}
else
{
Dictionary<string, LocalVariableEntry> local_names = new Dictionary<string, LocalVariableEntry>();
for (int k = 0; k < locals.Length; k++)
{
LocalVariableEntry local = locals[k];
if (local_names.ContainsKey(local.Name))
{
flags |= MethodEntry.Flags.LocalNamesAmbiguous;
break;
}
local_names.Add(local.Name, local);
}
}
}
开发者ID:qq1792,项目名称:LSharp,代码行数:48,代码来源:MethodEntry.cs
示例4: ReadLocalVariables
static void ReadLocalVariables (MethodEntry entry, MethodBody body, Scope [] scopes)
{
var locals = entry.GetLocals ();
foreach (var local in locals) {
var variable = body.Variables [local.Index];
variable.Name = local.Name;
var index = local.BlockIndex;
if (index < 0 || index >= scopes.Length)
continue;
var scope = scopes [index];
if (scope == null)
continue;
scope.Variables.Add (variable);
}
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:18,代码来源:MdbReader.cs
示例5: ReadLocalVariables
private static void ReadLocalVariables(MethodEntry entry, MethodBody body, Scope[] scopes)
{
LocalVariableEntry[] locals = entry.GetLocals();
LocalVariableEntry[] array = locals;
for (int i = 0; i < array.Length; i++)
{
LocalVariableEntry local = array[i];
VariableDefinition variable = body.Variables[local.Index];
variable.Name = local.Name;
int index = local.BlockIndex;
if (index >= 0 && index < scopes.Length)
{
Scope scope = scopes[index];
if (scope != null)
{
scope.Variables.Add(variable);
}
}
}
}
开发者ID:qq1792,项目名称:LSharp,代码行数:20,代码来源:MdbReader.cs
示例6: ReadLineNumbers
private void ReadLineNumbers(MethodEntry entry, InstructionMapper mapper)
{
Document document = null;
LineNumberTable table = entry.GetLineNumberTable();
LineNumberEntry[] lineNumbers = table.LineNumbers;
for (int i = 0; i < lineNumbers.Length; i++)
{
LineNumberEntry line = lineNumbers[i];
Instruction instruction = mapper(line.Offset);
if (instruction != null)
{
if (document == null)
{
document = this.GetDocument(entry.CompileUnit.SourceFile);
}
instruction.SequencePoint = new SequencePoint(document)
{
StartLine = line.Row,
EndLine = line.Row
};
}
}
}
开发者ID:qq1792,项目名称:LSharp,代码行数:23,代码来源:MdbReader.cs
示例7: ReadLineNumbers
void ReadLineNumbers (MethodEntry entry, MethodSymbols symbols)
{
var table = entry.GetLineNumberTable ();
var lines = table.LineNumbers;
var instructions = symbols.instructions = new Collection<InstructionSymbol> (lines.Length);
for (int i = 0; i < lines.Length; i++) {
var line = lines [i];
instructions.Add (new InstructionSymbol (line.Offset, new SequencePoint (GetDocument (entry.CompileUnit.SourceFile)) {
StartLine = line.Row,
EndLine = line.Row,
}));
}
}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:16,代码来源:MdbReader.cs
示例8: DefineMethod
public void DefineMethod (MonoSymbolFile file, int token)
{
MethodEntry entry = new MethodEntry (
file, _comp_unit.Entry, token, ScopeVariables,
Locals, method_lines.ToArray (), Blocks, null, MethodEntry.Flags.ColumnsInfoIncluded, ns_id);
file.AddMethod (entry);
}
开发者ID:dyxu,项目名称:vimrc,代码行数:8,代码来源:SourceMethodBuilder.cs
示例9: ProcessMethod
private void ProcessMethod (MethodBase monoMethod, MethodEntry entry, ClassCoverageItem klass, string methodName, string cov_info)
开发者ID:bennidhamma,项目名称:monocov,代码行数:1,代码来源:CoverageModel.cs
示例10: read_methods
void read_methods ()
{
lock (this) {
if (method_token_hash != null)
return;
method_token_hash = new Dictionary<int, MethodEntry> ();
method_list = new List<MethodEntry> ();
long old_pos = reader.BaseStream.Position;
reader.BaseStream.Position = ot.MethodTableOffset;
for (int i = 0; i < MethodCount; i++) {
MethodEntry entry = new MethodEntry (this, reader, i + 1);
method_token_hash.Add (entry.Token, entry);
method_list.Add (entry);
}
reader.BaseStream.Position = old_pos;
}
}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:21,代码来源:MonoSymbolFile.cs
示例11: AddMethod
internal void AddMethod (MethodEntry entry)
{
methods.Add (entry);
}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:4,代码来源:MonoSymbolFile.cs
示例12: MonoMethod
public MonoMethod(MonoSymbolFile file, MethodSource source, int domain,
C.MethodEntry method, Cecil.MethodDefinition mdef)
: base(source.Name, file.ImageFile, file.Module)
{
this.file = file;
this.source = source;
this.domain = domain;
this.method = method;
this.mdef = mdef;
foreach (Cecil.CustomAttribute cattr in mdef.CustomAttributes) {
string cname = cattr.Constructor.DeclaringType.FullName;
if ((cname == "System.Diagnostics.DebuggerHiddenAttribute") ||
(cname == "System.Runtime.CompilerServices.CompilerGeneratedAttribute"))
is_compiler_generated = true;
}
}
开发者ID:atomia,项目名称:mono_debugger,代码行数:17,代码来源:MonoSymbolFile.cs
示例13: DefineMethod
public void DefineMethod(MonoSymbolFile file)
{
LineNumberEntry[] lines = new LineNumberEntry[this.method_lines_pos];
Array.Copy(this.method_lines, lines, this.method_lines_pos);
MethodEntry entry = new MethodEntry(file, this._comp_unit.Entry, this._method.Token, this.ScopeVariables, this.Locals, lines, this.Blocks, this.RealMethodName, (MethodEntry.Flags)0, this._ns_id);
file.AddMethod(entry);
}
开发者ID:qq1792,项目名称:LSharp,代码行数:7,代码来源:SourceMethodBuilder.cs
示例14: DefineMethod
public void DefineMethod (MonoSymbolFile file, int token)
{
var blocks = Blocks;
//
// When index is provided by user it can be inserted in
// any order but mdb format does not store its value. It
// uses store order instead as the index.
//
Array.Sort (blocks, (x, y) => x.Index.CompareTo (y.Index));
var entry = new MethodEntry (
file, _comp_unit.Entry, token, ScopeVariables,
Locals, method_lines.ToArray (), blocks, null, MethodEntry.Flags.ColumnsInfoIncluded, ns_id);
file.AddMethod (entry);
}
开发者ID:REALTOBIZ,项目名称:mono,代码行数:17,代码来源:SourceMethodBuilder.cs
示例15: ReadScopes
void ReadScopes (MethodEntry entry, MethodBody body, IDictionary instructions)
{
CodeBlockEntry[] blocks = entry.GetCodeBlocks ();
foreach (CodeBlockEntry cbe in blocks) {
if (cbe.BlockType != CodeBlockEntry.Type.Lexical)
continue;
Scope s = new Scope ();
s.Start = GetInstruction (body, instructions, cbe.StartOffset);
s.End = GetInstruction(body, instructions, cbe.EndOffset);
m_scopes [entry.Index] = s;
if (!AddScope (body, s))
body.Scopes.Add (s);
}
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:16,代码来源:MdbReader.cs
示例16: ReadLocalVariables
static void ReadLocalVariables(MethodEntry entry, ScopeDebugInformation [] scopes)
{
var locals = entry.GetLocals ();
foreach (var local in locals) {
var variable = new VariableDebugInformation (local.Index, local.Name);
var index = local.BlockIndex;
if (index < 0 || index >= scopes.Length)
continue;
var scope = scopes [index];
if (scope == null)
continue;
scope.Variables.Add (variable);
}
}
开发者ID:jbevain,项目名称:cecil,代码行数:18,代码来源:MdbReader.cs
示例17: DefineMethod
public void DefineMethod (MonoSymbolFile file)
{
LineNumberEntry[] lines = new LineNumberEntry [method_lines_pos];
Array.Copy (method_lines, lines, method_lines_pos);
MethodEntry entry = new MethodEntry (
file, _comp_unit.Entry, _method.Token, ScopeVariables,
Locals, lines, Blocks, RealMethodName, _method_flags,
_ns_id);
file.AddMethod (entry);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:12,代码来源:MonoSymbolWriter.cs
示例18: MonoMethodLineNumberTable
public MonoMethodLineNumberTable(MonoSymbolFile file, MonoMethod method,
MethodSource source, C.MethodEntry entry,
JitLineNumberEntry[] jit_lnt)
: base(file, method)
{
this.method = method;
this.entry = entry;
this.line_numbers = jit_lnt;
}
开发者ID:atomia,项目名称:mono_debugger,代码行数:9,代码来源:MonoSymbolFile.cs
示例19: DefineMethod
public MethodEntry DefineMethod (CompileUnitEntry comp_unit, int token,
ScopeVariable[] scope_vars, LocalVariableEntry[] locals,
LineNumberEntry[] lines, CodeBlockEntry[] code_blocks,
string real_name, MethodEntry.Flags flags,
int namespace_id)
{
if (reader != null)
throw new InvalidOperationException ();
MethodEntry method = new MethodEntry (
this, comp_unit, token, scope_vars, locals, lines, code_blocks,
real_name, flags, namespace_id);
AddMethod (method);
return method;
}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:15,代码来源:MonoSymbolFile.cs
示例20: MonoMethodSource
public MonoMethodSource(MonoSymbolFile file, SourceFile source_file,
C.MethodEntry method, Cecil.MethodDefinition mdef,
MonoClassType klass, MonoFunctionType function)
{
this.file = file;
this.source_file = source_file;
this.method = method;
this.mdef = mdef;
this.function = function;
this.klass = klass;
full_name = method.GetRealName ();
if (full_name == null)
full_name = MonoSymbolFile.GetMethodName (mdef);
C.LineNumberEntry start, end;
C.LineNumberTable lnt = method.GetLineNumberTable ();
if (lnt.GetMethodBounds (out start, out end))
start_row = start.Row; end_row = end.Row;
}
开发者ID:atomia,项目名称:mono_debugger,代码行数:20,代码来源:MonoSymbolFile.cs
注:本文中的Mono.CompilerServices.SymbolWriter.MethodEntry类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论