This is an archive of the discontinued LLVM Phabricator instance.

Move PDB parsing code into a library
ClosedPublic

Authored by zturner on Apr 20 2016, 2:44 PM.

Details

Summary

PDB parsing code was hand-rolled into llvm-pdbdump. This patch moves the parsing of this code into DebugInfoPDB and makes the dumper use this.

This is achieved by implementing the skeleton of RawPdbSession, the non-DIA counterpart to the existing PDB read interface. None of the type / source file / etc information is accessible yet, so this implementation is not yet close to achieving parity with the DIA counterpart, but the RawSession class simply holds a reference to a PDBFile class which handles parsing the file format. Additionally a PDBStream class is introduced which allows accessing the bytes of a particular stream in a PDB file.

Feel free to add another reviewer if you can think of someone better.

Diff Detail

Event Timeline

zturner updated this revision to Diff 54424.Apr 20 2016, 2:44 PM
zturner retitled this revision from to Move PDB parsing code into a library.
zturner updated this object.
zturner added a reviewer: rnk.
zturner added a subscriber: llvm-commits.
rnk accepted this revision.Apr 20 2016, 3:54 PM
rnk edited edge metadata.

Looks good. I had some minor comments. Let's see if David has any thoughts on this.

include/llvm/DebugInfo/PDB/Raw/PDBStream.h
25

Any reason this interface went to leading upper case?

lib/DebugInfo/PDB/Raw/PDBFile.cpp
11

We don't usually separate local includes from other LLVM includes

This revision is now accepted and ready to land.Apr 20 2016, 3:54 PM
majnemer accepted this revision.Apr 21 2016, 11:11 AM
majnemer edited edge metadata.

LGTM with Reid's comments addressed.

Please make sure you do not introduce a bunch of warnings.

lib/DebugInfo/PDB/PDB.cpp
33
control may reach end of non-void function
44

dito

lib/DebugInfo/PDB/Raw/PDBFile.cpp
19
warning: variable 'Magic' is not needed and will not be emitted
189

dito

lib/DebugInfo/PDB/Raw/RawSession.cpp
35

This warns

41

dito

43

dito

Looks like this also broke DebugInfo/PDB/pdbdump-headers.test

Looks like this also broke DebugInfo/PDB/pdbdump-headers.test

What OS are you running on?

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r267049.