corert icon indicating copy to clipboard operation
corert copied to clipboard

Support for portable IL PDB

Open jkotas opened this issue 11 years ago • 3 comments

jkotas avatar Oct 11 '15 04:10 jkotas

See https://github.com/dotnet/corefx/pull/3560 that added the portable PDB reader.

jkotas avatar Oct 22 '15 00:10 jkotas

I will take a look

jkotas avatar Jan 07 '16 01:01 jkotas

@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);
    }
}

schellap avatar Jan 07 '16 01:01 schellap