RemedyBG»Forums
13 posts
The classic game dev.
What library do you use to consume PDB files ?
Edited by Scr3amer on

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

304 posts / 1 project
None
What library do you use to consume PDB files ?

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.

Mārtiņš Možeiko
2547 posts / 2 projects
What library do you use to consume PDB files ?
Edited by Mārtiņš Možeiko on

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.

What library do you use to consume PDB files ?

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.

13 posts
The classic game dev.
What library do you use to consume PDB files ?
Edited by Scr3amer on
Replying to stefanreinalter. (#29828)

The PDB world is small Stefan here we meet again :))

Btw I added a PR for a small typo I found :P

13 posts
The classic game dev.
What library do you use to consume PDB files ?
Replying to x13pixels (#29826)

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.

13 posts
The classic game dev.
What library do you use to consume PDB files ?
Replying to mmozeiko (#29827)

Thanks for the suggestion. That's what I was actually already doing.

For future reference if people wonder how to output PDB with clang:

-g -gcodeview to compile

and then for the linker

-Wl,--pdb=

Mārtiņš Možeiko
2547 posts / 2 projects
What library do you use to consume PDB files ?
Edited by Mārtiņš Možeiko on

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.