Skip to content

Instantly share code, notes, and snippets.

@jbevain
Created February 1, 2017 20:47
Show Gist options
  • Save jbevain/7a44d47ad6075c34aba7120561b74e81 to your computer and use it in GitHub Desktop.
Save jbevain/7a44d47ad6075c34aba7120561b74e81 to your computer and use it in GitHub Desktop.
diff --git a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
index 05ab3fb..e55109f 100644
--- a/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
+++ b/symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs
@@ -94,7 +94,6 @@ static void ReadLocalVariables (MethodEntry entry, MethodBody body, Scope [] sco
void ReadLineNumbers (MethodEntry entry, InstructionMapper mapper)
{
- Document document = null;
var table = entry.GetLineNumberTable ();
foreach (var line in table.LineNumbers) {
@@ -102,8 +101,8 @@ void ReadLineNumbers (MethodEntry entry, InstructionMapper mapper)
if (instruction == null)
continue;
- if (document == null)
- document = GetDocument (entry.CompileUnit.SourceFile);
+ var source_file = symbol_file.GetSourceFile (line.File);
+ var document = GetDocument (source_file);
instruction.SequencePoint = LineToSequencePoint (line, entry, document);
}
@@ -183,9 +182,11 @@ void ReadLineNumbers (MethodEntry entry, MethodSymbols symbols)
for (int i = 0; i < lines.Length; i++) {
var line = lines [i];
+ var source_file = symbol_file.GetSourceFile (line.File);
+
instructions.Add (new InstructionSymbol (
line.Offset,
- LineToSequencePoint (line, entry, GetDocument (entry.CompileUnit.SourceFile))));
+ LineToSequencePoint (line, entry, GetDocument (source_file))));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment