コード例 #1
0
        public void Close()
        {
            InitWriter();

            foreach (Method method in methods)
            {
                int remappedToken = method.token;
                remap.TryGetValue(remappedToken, out remappedToken);
                symUnmanagedWriter.OpenMethod(remappedToken);
                if (method.document != null)
                {
                    ISymUnmanagedDocumentWriter doc = method.document.GetUnmanagedDocument(symUnmanagedWriter);
                    symUnmanagedWriter.DefineSequencePoints(doc, method.offsets.Length, method.offsets, method.lines, method.columns, method.endLines, method.endColumns);
                }
                foreach (Scope scope in method.scopes)
                {
                    scope.Do(symUnmanagedWriter);
                }
                symUnmanagedWriter.CloseMethod();
            }

            foreach (Document doc in documents.Values)
            {
                doc.Release();
            }

            symUnmanagedWriter.Close();
            Marshal.ReleaseComObject(symUnmanagedWriter);
            symUnmanagedWriter = null;
            documents.Clear();
            methods.Clear();
            remap.Clear();
            reversemap.Clear();
        }
コード例 #2
0
ファイル: SymbolWriter.cs プロジェクト: parhelia512/perwapi
        public void DefineSequencePoints(
            object doc,
            int[] offsets, int[] lines, int[] cols, int[] endLines, int[] endCols)
        {
            ISymUnmanagedDocumentWriter pDoc = (ISymUnmanagedDocumentWriter)doc;

            writer.DefineSequencePoints(pDoc, offsets.Length, offsets, lines, cols, endLines, endCols);
        }
コード例 #3
0
ファイル: SymbolWriterImpl.cs プロジェクト: haise0/dnlib-h0
 public override void DefineSequencePoints(ISymbolDocumentWriter document, uint arraySize, int[] offsets, int[] lines, int[] columns, int[] endLines, int[] endColumns)
 {
     if (document is not SymbolDocumentWriter doc)
     {
         throw new ArgumentException("document isn't a non-null SymbolDocumentWriter instance");
     }
     writer.DefineSequencePoints(doc.SymUnmanagedDocumentWriter, arraySize, offsets, lines, columns, endLines, endColumns);
 }
コード例 #4
0
        public void DefineSequencePoints(ISymbolDocumentWriter document, int[] offsets, int[] lines, int[] columns, int[] endLines, int[] endColumns)
        {
            var doc = document as SymbolDocumentWriter;

            if (doc == null)
            {
                throw new ArgumentException("document isn't a non-null SymbolDocumentWriter instance");
            }
            if (offsets == null || lines == null || columns == null ||
                endLines == null || endColumns == null ||
                offsets.Length != lines.Length ||
                offsets.Length != columns.Length ||
                offsets.Length != endLines.Length ||
                offsets.Length != endColumns.Length)
            {
                throw new ArgumentException("Invalid arrays");
            }
            writer.DefineSequencePoints(doc.SymUnmanagedDocumentWriter, (uint)offsets.Length, offsets, lines, columns, endLines, endColumns);
        }
コード例 #5
0
 private void WriteSequencePoints(ISymUnmanagedDocumentWriter symDocument, int count)
 {
     try
     {
         _symWriter.DefineSequencePoints(
             symDocument,
             (uint)count,
             _sequencePointOffsets,
             _sequencePointStartLines,
             _sequencePointStartColumns,
             _sequencePointEndLines,
             _sequencePointEndColumns);
     }
     catch (Exception ex)
     {
         throw new PdbWritingException(ex);
     }
 }
コード例 #6
0
        private void WriteSource(Source source)
        {
            var sequencePoints = source.SequencePoints;
            var count          = sequencePoints.Count;

            var offsets    = new int[count];
            var lines      = new int[count];
            var columns    = new int[count];
            var endLines   = new int[count];
            var endColumns = new int[count];

            for (int i = 0; i < sequencePoints.Count; i++)
            {
                var sequencePoint = sequencePoints[i];
                offsets[i]    = sequencePoint.Offset;
                lines[i]      = sequencePoint.Line;
                columns[i]    = sequencePoint.Column;
                endLines[i]   = sequencePoint.EndLine;
                endColumns[i] = sequencePoint.EndColumn;
            }

            pdb.DefineSequencePoints(UnmanagedDocumentFor(source.Document), count, offsets, lines, columns, endLines, endColumns);
        }
コード例 #7
0
ファイル: SymWriter.cs プロジェクト: IrwinDong/cecil
 public void DefineSequencePoints(SymDocumentWriter document, int[] offsets, int[] lines, int[] columns, int[] endLines, int[] endColumns)
 {
     m_writer.DefineSequencePoints(document.GetUnmanaged(), offsets.Length, offsets, lines, columns, endLines, endColumns);
 }