Require support to use LLVM's PDB classes and pdbutil


I’m trying to parse debug information out of PDB files that’s created by visual studio, and also maybe producing stacktrace on linux.
Does anyone has leads to how I can do that with LLVM’s pdbutil? Or point me to a documentation about that?



I would say that llvm-pdbutil mainly exists to dump PDBs as human readable text, and to translate them to and from YAML. As far as interpreting the contents of the PDB to do something useful, like produce a stack trace, goes, the consumer of LLVM’s PDB reading libraries is responsible for doing that. For example, LLDB at some point will likely implement stack unwinding with unwind data from PDBs.

I don’t think we have any existing documentation or references for coding against the LLVM native PDB reading APIs, but you can look at the code in LLDB to get an idea for how it can be done.

I’d start with reading the documentation about PDB file format, described here:

There’s a lot there, but if you want to interpret the contents on your own (even using LLVM’s PDB libraries to do the low level work) you’re going to need to understand it.

Once you have a basic understanding of what goes into a PDB file and how it’s organized, LLVM’s PDB APIs should (hopefully) be fairly self-explanatory and you can read the code of llvm-pdbutil to see how it does various things, which you can copy.

Hey, Thank you very much for the quick response. :slight_smile:
I’ve built the doxygen for llvm last night, I hope it can help me understanding the inner workings.

Expect me to return soon after I’ve read the code and try to use LLVM’s PDB API.