Esempio n. 1
0
 /// <summary>
 /// Create a new sequence point.
 /// </summary>
 /// <param name="offset"></param>
 /// <param name="doc">The source file.</param>
 /// <param name="line">The line the point begins on.</param>
 /// <param name="col">The column the point begins with.</param>
 /// <param name="endLine">The line the point ends on.</param>
 /// <param name="endCol">The column the point ends with.</param>
 internal PDBSequencePoint(int offset, PDBDocument doc, int line, int col, int endLine, int endCol)
 {
     Contract.Requires(doc != null);
     Offset    = offset;
     Document  = doc;
     Line      = line;
     Column    = col;
     EndLine   = endLine;
     EndColumn = endCol;
 }
Esempio n. 2
0
        public void ReadPDB()
        {
            PDBReader reader = new PDBReader(this.fileName);

            foreach (ClassDef cDef in GetClasses())
            {
                foreach (MethodDef mDef in cDef.GetMethods())
                {
                    CILInstructions buffer = mDef.GetCodeBuffer();
                    PDBMethod       meth   = reader.GetMethod((int)mDef.Token());

                    if (meth == null)
                    {
                        continue; // no symbols for this method
                    }
                    PDBSequencePoint[] spList = meth.SequencePoints;

                    MergeBuffer mergeBuffer = new MergeBuffer(buffer.GetInstructions());

                    PDBScope outer = meth.Scope;
                    Scope    root  = ReadPDBScope(outer, mergeBuffer, null, mDef);
                    buffer.currentScope = root;
                    bool hasRootScope = mergeBuffer.hasRootScope();

                    if (!hasRootScope)
                    {
                        mergeBuffer.Add(new OpenScope(root), (uint)0);
                    }
                    foreach (PDBSequencePoint sp in spList)
                    {
                        PDBDocument doc = sp.Document;
                        mergeBuffer.Add(
                            new Line((uint)sp.Line, (uint)sp.Column, (uint)sp.EndLine, (uint)sp.EndColumn,
                                     SourceFile.GetSourceFile(doc.URL, doc.Language, doc.LanguageVendor, doc.DocumentType)),
                            (uint)sp.Offset);
                    }
                    if (!hasRootScope)
                    {
                        mergeBuffer.Add(new CloseScope(root), (uint)outer.EndOffset);
                    }

                    buffer.SetInstructions(mergeBuffer.Instructions);
                }
            }
        }
Esempio n. 3
0
 /// <summary>
 /// Create a new sequence point.
 /// </summary>
 /// <param name="offset"></param>
 /// <param name="doc">The source file.</param>
 /// <param name="line">The line the point begins on.</param>
 /// <param name="col">The column the point begins with.</param>
 /// <param name="endLine">The line the point ends on.</param>
 /// <param name="endCol">The column the point ends with.</param>
 internal PDBSequencePoint(int offset, PDBDocument doc, int line, int col, int endLine, int endCol)
 {
     Contract.Requires(doc != null);
     Offset = offset;
     Document = doc;
     Line = line;
     Column = col;
     EndLine = endLine;
     EndColumn = endCol;
 }