SourceFile GetSourceFile(Document document) { var url = document.Url; SourceFile source_file; if (source_files.TryGetValue (url, out source_file)) return source_file; var entry = writer.DefineDocument (url); var compile_unit = writer.DefineCompilationUnit (entry); source_file = new SourceFile (compile_unit, entry); source_files.Add (url, source_file); return source_file; }
SymDocumentWriter GetDocument(Document document) { if (document == null) return null; SymDocumentWriter doc_writer; if (documents.TryGetValue (document.Url, out doc_writer)) return doc_writer; doc_writer = writer.DefineDocument ( document.Url, document.Language.ToGuid (), document.LanguageVendor.ToGuid (), document.Type.ToGuid ()); documents [document.Url] = doc_writer; return doc_writer; }
Document GetDocument(PdbSource source) { string name = source.name; Document document; if (documents.TryGetValue (name, out document)) return document; document = new Document (name) { Language = source.language.ToLanguage (), LanguageVendor = source.vendor.ToVendor (), Type = source.doctype.ToType (), }; documents.Add (name, document); return document; }
static void ReadLine(PdbLine line, Document document, InstructionMapper mapper) { var instruction = mapper ((int) line.offset); if (instruction == null) return; var sequence_point = new SequencePoint (document); sequence_point.StartLine = (int) line.lineBegin; sequence_point.StartColumn = (int) line.colBegin; sequence_point.EndLine = (int) line.lineEnd; sequence_point.EndColumn = (int) line.colEnd; instruction.SequencePoint = sequence_point; }
static SequencePoint LineToSequencePoint(LineNumberEntry line, MethodEntry entry, Document document) { return new SequencePoint (document) { StartLine = line.Row, EndLine = line.EndRow, StartColumn = line.Column, EndColumn = line.EndColumn, }; }
Document GetDocument(SourceFileEntry file) { var file_name = file.FileName; Document document; if (documents.TryGetValue (file_name, out document)) return document; document = new Document (file_name); documents.Add (file_name, document); return document; }