corert
corert copied to clipboard
Support for portable IL PDB
See https://github.com/dotnet/corefx/pull/3560 that added the portable PDB reader.
I will take a look
@nguerrera suggested this small sample code, it might be useful. I found that this logic needs to be refactored to fit with the current reader.
using (var dll = File.OpenRead(@"d:\temp\ppdb.dll"))
using (var dllReader = new PEReader(dll))
{
var dllMDReader = dllReader.GetMetadataReader();
var pdbBytes = File.ReadAllBytes(@"d:\temp\ppdb.pdb");
fixed (byte* pdbBytePtr = pdbBytes)
{
var pdbdMDReader = new MetadataReader(pdbBytePtr, pdbBytes.Length);
MethodDefinitionHandle method = dllMDReader.MethodDefinitions.First();
MethodDebugInformationHandle h = method.ToDebugInformationHandle();
MethodDebugInformation info = pdbdMDReader.GetMethodDebugInformation(h);
Console.WriteLine(info.GetSequencePoints().First().StartLine);
}
}