symreader-converter icon indicating copy to clipboard operation
symreader-converter copied to clipboard

Support converting embedded Pdbs to XML

Open KirillOsenkov opened this issue 2 years ago • 6 comments

KirillOsenkov avatar Dec 02 '21 21:12 KirillOsenkov

The APIs I needed weren't public. Maybe I missed something? Feel free to push directly to the PR branch to fix.

KirillOsenkov avatar Dec 06 '21 19:12 KirillOsenkov

See https://github.com/dotnet/metadata-tools/blob/555fdc5c22d4bed4a2dd306b528e0c04e1c2ac23/src/mdv/Mdv.cs#L112

tmat avatar Dec 06 '21 20:12 tmat

I'm sorry, I don't quite understand how to use the link you provided to get rid of reflection here.

My task is given a MetadataReaderProvider how to obtain the uncompressed byte[] of the embedded Pdb or a Stream that I could pass to the Pdb2Xml dumper.

KirillOsenkov avatar Dec 06 '21 23:12 KirillOsenkov

I see. You can use MetadataReader.MetadataPointer and MetadataReader.Length to read the data.

tmat avatar Dec 07 '21 00:12 tmat

I'm sorry again, I'm not well-versed in pointers and unsafe code, so I really don't know how to do this.

It would be great if you could just do it yourself when you have time (not urgent).

KirillOsenkov avatar Dec 07 '21 00:12 KirillOsenkov

I think PEReader should be able to read from an RVA given the position and size, and fill a byte array. Not sure if disk layout/memory layout of the PE format is relevant here.

KirillOsenkov avatar Dec 21 '21 04:12 KirillOsenkov