Hey there,
I was mostly curious on how you parsed the PDB files because I am reading some doc online and it is kind of a closed format, no real good doc so I was wondering how you achieved that, 3rd party library ?
Also do you think you would support dwarf at some point in the future ? Out of curiosity for people who for instance uses gcc with mingw.
Cheers
I wrote my own PDB parser based on the information that Microsoft released here: https://github.com/microsoft/microsoft-pdb
The plan is to support DWARF at some point. Not likely anytime soon, though.
As an option you can consider using clang
instead of gcc
. Even if you target mingw environment, clang is able to produce pdb files that works with Windows debuggers. And clang is mostly gcc compatible, there should be almost none or very little of source file incompatibilities.
I open-sourced my PDB reader that is used in Live++: https://github.com/MolecularMatters/raw_pdb
Depending on what information you need, there's a good chance RawPDB can consume it.
Understood ! Thanks for the reply !
That's gonna be so nice for the DWARF :D. Will you release it on Linux in that long term plan of yours ? I would love to have RemedyBG on Linux too <3 !!!
My money is ready :P.
Extra useless info: I wrote a PDB parser back in Q3 2019 but it was bugged and I never really had the time to go back into it. I remember using the Microsoft repo too but I noticed not all files were available (check for instance cvdump.exe, the source code they provide is incomplete). It was a lot of guess work.
Btw if you're interested into looking at non-opensource code, then here's pdb/dwarf parser from Epic Games: https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Source/Runtime/SymsLib
It is under Unreal Engine license. If you don't see the source code, you need to add your account to Epic organization on github by agreeing to license: https://www.unrealengine.com/en-US/ue-on-github - read the FAQ about details of license at the bottom of page.
Originally code was written in RAD Game Tools for our secret projects. But now it is actively maintained & used in Unreal Insights profiler, Telemetry profiler, and few other places.
In Unreal Insights it replaced dbghelp and loads pdb/dwarf symbols multiple of magnitudes faster on UE binary sizes. The loading code & symbol location (filename/line) resolving can be seen here: https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Source/Developer/TraceServices/Private/Model/SymslibResolver.cpp This file only is interested in mapping address -> symbol location. But SymsLib can extract all the other information from pdb/dwarf too, like symbol types.