This is an archive of the discontinued LLVM Phabricator instance.

[pdb] added support for dumping globals stream
ClosedPublic

Authored by inglorion on Oct 19 2016, 3:42 PM.

Details

Summary

This adds support for dumping the globals stream from PDB files using llvm-pdbdump, similar to the support we have for the publics stream.

Event Timeline

inglorion updated this revision to Diff 75244.Oct 19 2016, 3:42 PM
inglorion retitled this revision from to [pdb] added support for dumping globals stream.
inglorion updated this object.
inglorion added reviewers: ruiu, zturner.
ruiu edited edge metadata.Oct 19 2016, 3:54 PM

Overall looking good, a few nits.

include/llvm/DebugInfo/PDB/Raw/GlobalsStream.h
11

nit: for include guards, CamelCase is usually converted to CAMEL_CASE, so s/GLOBALSSTREAM/GLOBALS_STREAM/

18

Remove this blank line.

27

Ditto

lib/DebugInfo/PDB/Raw/GSI.cpp
76–77
If (auto EC = ...)
lib/DebugInfo/PDB/Raw/GSI.h
18

Nice comment!

zturner added inline comments.Oct 19 2016, 3:59 PM
include/llvm/DebugInfo/PDB/Raw/GlobalsStream.h
29

Can you mark this explicit

lib/DebugInfo/PDB/Raw/GlobalsStream.cpp
32

AFAICT this class seems almost identical to PublicsStream. Can we merge them and just have one class that handles both stream types?

lib/DebugInfo/PDB/Raw/PublicsStream.cpp
27

Headers should go under include/llvm/DebugInfo/PDB/Raw, and then this directive will need to be updated to show the whole path.

inglorion updated this revision to Diff 75248.Oct 19 2016, 4:00 PM
inglorion marked 5 inline comments as done.
inglorion edited edge metadata.

@ruiu's comments (thanks!)

inglorion added inline comments.Oct 19 2016, 4:02 PM
lib/DebugInfo/PDB/Raw/GSI.h
18

I knew you would like it. ;-)

inglorion updated this revision to Diff 75250.Oct 19 2016, 4:20 PM

added missing "explicit" - thanks @zturner

inglorion added inline comments.Oct 19 2016, 4:43 PM
lib/DebugInfo/PDB/Raw/GlobalsStream.cpp
32

There are some structures that are common to both, but the streams don't have the same format. In particular, the publics stream has another header at the front, and a couple of maps at the end that do not occur in the globals stream. I decided to give each stream type its own class, but factor out the functionality for parsing the common structures so that they can share it. Ok to keep it that way?

lib/DebugInfo/PDB/Raw/PublicsStream.cpp
27

I thought of it more as an implementation detail - it's just there so that GlobalsStream.cpp and PublicsStream.cpp can get the declarations they need for the common code. Can I keep it this way and move it to include if we ever decide we want this to be a more public API?

inglorion updated this revision to Diff 75352.Oct 20 2016, 2:04 PM

added missing "-globals" in pdbdump-headers.test

Is this good to go now?

zturner accepted this revision.Oct 21 2016, 10:18 AM
zturner edited edge metadata.
This revision is now accepted and ready to land.Oct 21 2016, 10:18 AM
This revision was automatically updated to reflect the committed changes.