Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJb Evain <jb@evain.net>2015-03-21 00:12:28 +0300
committerJb Evain <jb@evain.net>2015-03-21 00:12:28 +0300
commit7826271ad97c5120c74bce30b7cc911464447475 (patch)
treef313f25952042968b4882cc9f1065f9ce72204c2 /symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
parent3f697eb61052afcd05d40320fe30324e6da2834e (diff)
Add support for reading/writing new mdb info
Diffstat (limited to 'symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs')
-rw-r--r--symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs35
1 files changed, 27 insertions, 8 deletions
diff --git a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
index 658e9f3..1da6653 100644
--- a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
+++ b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
@@ -124,10 +124,7 @@ namespace Mono.Cecil.Mdb {
if (document == null)
document = GetDocument (entry.CompileUnit.SourceFile);
- instruction.SequencePoint = new SequencePoint (document) {
- StartLine = line.Row,
- EndLine = line.Row,
- };
+ instruction.SequencePoint = LineToSequencePoint (line, entry, document);
}
}
@@ -205,10 +202,9 @@ namespace Mono.Cecil.Mdb {
for (int i = 0; i < lines.Length; i++) {
var line = lines [i];
- instructions.Add (new InstructionSymbol (line.Offset, new SequencePoint (GetDocument (entry.CompileUnit.SourceFile)) {
- StartLine = line.Row,
- EndLine = line.Row,
- }));
+ instructions.Add (new InstructionSymbol (
+ line.Offset,
+ LineToSequencePoint (line, entry, GetDocument (entry.CompileUnit.SourceFile))));
}
}
@@ -223,9 +219,32 @@ namespace Mono.Cecil.Mdb {
}
}
+ 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,
+ };
+ }
+
public void Dispose ()
{
symbol_file.Dispose ();
}
}
+
+ static class MethodEntryExtensions {
+
+ public static bool HasColumnInfo (this MethodEntry entry)
+ {
+ return (entry.MethodFlags & MethodEntry.Flags.ColumnsInfoIncluded) != 0;
+ }
+
+ public static bool HasEndInfo (this MethodEntry entry)
+ {
+ return (entry.MethodFlags & MethodEntry.Flags.EndInfoIncluded) != 0;
+ }
+ }
}