本文整理汇总了C#中System.Reflection.Emit.ILGenerator.MarkSequencePoint方法的典型用法代码示例。如果您正苦于以下问题:C# ILGenerator.MarkSequencePoint方法的具体用法?C# ILGenerator.MarkSequencePoint怎么用?C# ILGenerator.MarkSequencePoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.Emit.ILGenerator
的用法示例。
在下文中一共展示了ILGenerator.MarkSequencePoint方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MarkSequencePoint
internal override void MarkSequencePoint(LambdaExpression method, MethodBase methodBase, ILGenerator ilg, DebugInfoExpression sequencePoint)
{
MethodBuilder builder = methodBase as MethodBuilder;
if (builder != null)
{
ilg.MarkSequencePoint(this.GetSymbolWriter(builder, sequencePoint.Document), sequencePoint.StartLine, sequencePoint.StartColumn, sequencePoint.EndLine, sequencePoint.EndColumn);
}
}
示例2: EmitLineInfo
internal void EmitLineInfo(ILGenerator ilgen, int line, int column, int endLine, int endColumn) {
if (debugOn) {
if (checkForFirst && line == this.firstStartLine && column == this.firstStartCol && endLine == this.firstEndLine
&& endColumn == this.firstEndCol)
checkForFirst = false;
else{
if (this.documentWriter == null)
this.documentWriter = this.GetSymDocument(documentName);
ilgen.MarkSequencePoint(this.documentWriter, this.startLine + line - this.lastLineInSource, this.startCol + column + 1,
this.startLine - this.lastLineInSource + endLine, this.startCol + endColumn + 1);
}
}
}
示例3: MarkSequencePoint
protected void MarkSequencePoint(ILGenerator gen)
{
if (debug & lines.BinarySearch(line.Number) < 0 && !line.Equals(LineId.None))
{
gen.MarkSequencePoint(writer, line.Number, 1, line.Number, 100);
lines.Add(line.Number);
}
}
示例4: MarkAndWriteLine
internal void MarkAndWriteLine(ILGenerator il, string text)
{
il.MarkSequencePoint(_symbolDocumentWriter, _currentLine, 1 + RealIndent, _currentLine, text.Length + 1 + RealIndent);
WriteLine(text);
}
示例5: MarkSequencePoint
protected void MarkSequencePoint(ILGenerator ilg, int bl, int bc, int el, int ec)
{
//if (make_next_spoint)
ilg.MarkSequencePoint(doc, bl, bc, el, ec + 1);
make_next_spoint = true;
}
示例6: EmitLineInfo
internal void EmitLineInfo(ILGenerator ilgen, int line, int column, int endLine, int endColumn)
{
if (this.debugOn)
{
if (((this.checkForFirst && (line == this.firstStartLine)) && ((column == this.firstStartCol) && (endLine == this.firstEndLine))) && (endColumn == this.firstEndCol))
{
this.checkForFirst = false;
}
else
{
if (this.documentWriter == null)
{
this.documentWriter = this.GetSymDocument(this.documentName);
}
ilgen.MarkSequencePoint(this.documentWriter, (this.startLine + line) - this.lastLineInSource, (this.startCol + column) + 1, (this.startLine - this.lastLineInSource) + endLine, (this.startCol + endColumn) + 1);
}
}
}
示例7: WriteText
internal void WriteText(CodeLine line, ILGenerator generator, ISymbolDocumentWriter symbolDocument)
{
this.CheckForDisposed();
this.IndentLevel += (int)line.Indent;
var code = new string('\t', this.IndentLevel) + line.Code;
this.Writer.WriteLine(code);
this.Lines.Add(line);
this.LinesOfCode++;
if (line.IsDebuggable && generator != null && symbolDocument != null)
{
generator.MarkSequencePoint(symbolDocument,
this.LinesOfCode, this.IndentLevel + 1,
this.LinesOfCode, this.IndentLevel + 1 + line.Code.Length);
}
}
示例8: Generate
/// <summary>
/// Generate MSIL code to emit an instruction marker at the current
/// sequence in the output.
/// </summary>
/// <param name="il">ILGenerator object</param>
public override void Generate(ILGenerator il)
{
if (il == null) {
throw new ArgumentNullException("il");
}
if (Deleted) {
return;
}
il.MarkSequencePoint(_doc, _linenumber, 1, _linenumber, 100);
}
示例9: MarkSequencePoint
void MarkSequencePoint(ILGenerator il, Parse.Syntax.Node start, Parse.Syntax.Node end)
{
var sf = start.SourceFile;
ISymbolDocumentWriter doc;
if (Unit.SymbolDocs.TryGetValue(sf.Name, out doc))
{
int startLine, startColumn, endLine, endColumn;
sf.MatchState.GetLine(start.StartIndex, out startLine, out startColumn);
sf.MatchState.GetLine(end.NextIndex, out endLine, out endColumn);
il.MarkSequencePoint(doc, startLine, startColumn, endLine, endColumn);
}
}
示例10: HandleStatement
static void HandleStatement(Mizu.Parser.ParseNode stmt, ILGenerator ILgen, ref List<LocalBuilderEx> locals, out bool err)
{
switch (stmt.Token.Type)
{
case Parser.TokenType.VarStatement:
{
#region VAR
int i = 0;
while (i != stmt.Nodes.Count - 1)
{
var token = stmt.Nodes[i];
if (IsDebug)
{
int sline = 0, scol = 0;
FindLineAndCol(code, stmt.Token.StartPos, ref sline, ref scol);
int eline = 0, ecol = 0;
FindLineAndCol(code, stmt.Token.EndPos, ref eline, ref ecol);
ILgen.MarkSequencePoint(doc, sline, scol, eline, ecol);
}
if (token.Token.Type == TokenType.IDENTIFIER) //If its a var declaration.
{
if (locals.Find(it => it.Name == token.Token.Text) == null)
{
var set = stmt.Nodes[i + 1];
if (set.Token.Type == TokenType.SET)
{
i += 1;
var next = stmt.Nodes[i + 1];
if (next.Token.Type == TokenType.NUMBER) //Integers
{
//Declares a variable and leaves a reference to it.
LocalBuilderEx local = new LocalBuilderEx();
local.VariableType = typeof(int);
local.Base = ILgen.DeclareLocal(local.VariableType);
if (IsDebug) local.Base.SetLocalSymInfo(token.Token.Text); //Set variable name for debug info.
ILgen.Emit(OpCodes.Ldc_I4, int.Parse(next.Token.Text)); //Sets the number
ILgen.Emit(OpCodes.Stloc, (LocalBuilder)local.Base); //Assigns the number to the variable.
local.Name = token.Token.Text;
local.Type = LocalType.Var;
locals.Add(local); //Remembers the variable.
i += 1;
}
else if (next.Token.Type == TokenType.FLOAT)
{
//Declares a variable and leaves a reference to it.
LocalBuilderEx local = new LocalBuilderEx();
local.VariableType = typeof(float);
local.Base = ILgen.DeclareLocal(local.VariableType);
if (IsDebug) local.Base.SetLocalSymInfo(token.Token.Text); //Set variable name for debug info.
ILgen.Emit(OpCodes.Ldc_R4, float.Parse(next.Token.Text)); //Sets the number
ILgen.Emit(OpCodes.Stloc, (LocalBuilder)local.Base); //Assigns the number to the variable.
local.Name = token.Token.Text;
local.Type = LocalType.Var;
locals.Add(local); //Remembers the variable.
i += 1;
}
else if (next.Token.Type == TokenType.UPPER)
{
//A variable that reads from stdin (Console.ReadLne)
//Declares a variable and leaves a reference to it.
LocalBuilderEx local = new LocalBuilderEx();
local.VariableType = typeof(int);
local.Base = ILgen.DeclareLocal(local.VariableType);
local.Name = token.Token.Text;
local.Type = LocalType.Var;
if (IsDebug) local.Base.SetLocalSymInfo(token.Token.Text); //Set variable name for debug info.
try
{
//If theres a WAVEY symbol, print the variable name.
var wavey = stmt.Nodes[i + 2];
ILgen.Emit(OpCodes.Ldstr, local.Name + " = ");
ILgen.Emit(OpCodes.Call, typeof(Console).GetMethod("Write", new Type[] { typeof(string) }));
i += 1;
}
catch (Exception) { }
ILgen.Emit(OpCodes.Call, typeof(Console).GetMethod("ReadLine")); //Sets the number from STDIN.
//.........这里部分代码省略.........