Skip to content

Commit

Permalink
Read ikvm'ed symbol files
Browse files Browse the repository at this point in the history
* Previously the debug header was read without using the
AddressOfRawData
* It seems that for ikvm'ed symbol files this AddressOfRawData
can be 0 so to keep backwards compatibility we can check if PointerToRawData
is 0 in case of empty headers
* Add functional test for this scenario which uses ikvm 7.1.4532.2
* To read the assebmly immediately we also need the IKVM.Runtime.dll
  • Loading branch information
Vasile Tofan committed Jun 4, 2019
1 parent f6a871b commit c5c49a4
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Mono.Cecil.PE/ImageReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void ReadDebugHeader ()
PointerToRawData = ReadInt32 (),
};

if (directory.AddressOfRawData == 0) {
if (directory.PointerToRawData == 0) {
entries [i] = new ImageDebugHeaderEntry (directory, Empty<byte>.Array);
continue;
}
Expand Down
12 changes: 12 additions & 0 deletions symbols/pdb/Test/Mono.Cecil.Tests/PdbTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -463,5 +463,17 @@ public void CreateMethodFromScratch ()

Assert.AreEqual ("temp", method.DebugInformation.Scope.Variables [0].Name);
}

[Test]
public void IkvmDllSymbolsMatch()
{
TestModule ("ikvm-test.dll", module => {
var type = module.GetType ("com.test.TestClass");
var method = type.GetMethod ("Foo");
Assert.NotNull (type);
Assert.NotNull (method);
}, readOnly: !Platform.HasNativePdbSupport, symbolReaderProvider: typeof (PdbReaderProvider), symbolWriterProvider: typeof (PdbWriterProvider));
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit c5c49a4

Please sign in to comment.