当前位置: 首页>>代码示例>>C#>>正文


C# ILGenerator.MarkSequencePoint方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SymbolDocumentGenerator.cs

示例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);
     }
   }
 }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:13,代码来源:documentcontext.cs

示例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);
     }
 }
开发者ID:michaelgwelch,项目名称:mbasic99,代码行数:8,代码来源:Statement.cs

示例4: MarkAndWriteLine

 internal void MarkAndWriteLine(ILGenerator il, string text)
 {
     il.MarkSequencePoint(_symbolDocumentWriter, _currentLine, 1 + RealIndent, _currentLine, text.Length + 1 + RealIndent);
     WriteLine(text);
 }
开发者ID:yonglehou,项目名称:BTDB,代码行数:5,代码来源:SourceCodeWriter.cs

示例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;
 }
开发者ID:CSRedRat,项目名称:pascalabcnet,代码行数:6,代码来源:NETGenerator.cs

示例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);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:DocumentContext.cs

示例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);
            }
        }
开发者ID:JasonBock,项目名称:EmitDebugging,代码行数:19,代码来源:CodeDocument.cs

示例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);
 }
开发者ID:stevewpalmer,项目名称:jcom,代码行数:15,代码来源:msil.cs

示例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);
            }
        }
开发者ID:apterid,项目名称:apterid-bootstrap,代码行数:13,代码来源:ApteridGenerator.cs

示例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.

//.........这里部分代码省略.........
开发者ID:GunioRobot,项目名称:Project-Mizu,代码行数:101,代码来源:Program.cs


注:本文中的System.Reflection.Emit.ILGenerator.MarkSequencePoint方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。