This is an archive of the discontinued LLVM Phabricator instance.

[pdbdump] Print out New FPO stream contents.
ClosedPublic

Authored by ruiu on Jun 4 2016, 10:54 AM.

Details

Summary

The data strucutre in the new FPO stream is described in the
PE/COFF spec. There is one record per function if frame pointer
is omitted.

Diff Detail

Event Timeline

ruiu updated this revision to Diff 59652.Jun 4 2016, 10:54 AM
ruiu retitled this revision from to [pdbdump] Print out New FPO stream contents..
ruiu updated this object.
ruiu added a reviewer: zturner.
ruiu added a subscriber: llvm-commits.
majnemer added inline comments.
lib/DebugInfo/PDB/Raw/DbiStream.cpp
313–314

Should we check that StreamLen is a multiple of sizeof(FpoData)?

tools/llvm-pdbdump/LLVMOutputStyle.cpp
691–692

Shouldn't these be printed as booleans?

zturner added inline comments.Jun 4 2016, 9:45 PM
include/llvm/DebugInfo/PDB/Raw/RawTypes.h
83 ↗(On Diff #59652)

Do you think this should go in llvm/Support/COFF.h (or is it perhaps there already?)

tools/llvm-pdbdump/LLVMOutputStyle.h
36

You will probably need to update YamlOutputStyle.h as well, you can just have the method do nothing.

tools/llvm-pdbdump/llvm-pdbdump.cpp
157

I'm starting to wonder if all of this should be broken out into a separate tool. The whole yaml thing is to support pdb <-> yaml, so maybe it makes sense for llvm-pdbdump to continue as the "semantic" pretty dumper, and llvm-readpdb as the raw dumper. This way we could have a more consistent and easy to understand command line option set and not have to worry about option conflicts, and reading/writing pdbs would be the same tool, so be able to share a lot of the same code.

Anyway, I'm just thinking out loud, obvious that is outside the scope of this patch.

ruiu updated this revision to Diff 59672.Jun 5 2016, 11:51 AM
  • Moved FpoData struct to COFF.h.
  • Use printBoolean to print out boolean values.
include/llvm/DebugInfo/PDB/Raw/RawTypes.h
83 ↗(On Diff #59652)

Done.

lib/DebugInfo/PDB/Raw/DbiStream.cpp
313–314

I think readArray takes care of it.

tools/llvm-pdbdump/LLVMOutputStyle.cpp
691–692

Done.

tools/llvm-pdbdump/LLVMOutputStyle.h
36

Did you submit YamlOutputStyle.h already?

zturner edited edge metadata.Jun 5 2016, 1:23 PM
zturner added a subscriber: zturner.

I thought so, but if not ignore that comment

majnemer added inline comments.Jun 6 2016, 10:01 AM
lib/DebugInfo/PDB/Raw/DbiStream.cpp
313–314

I don't see such a check.

It checks that there is enough space for the requested number of elements
in the underlying stream, but it doesn't check that the stream length is
exactly the right length because it doesn't know if there is more data
after the array

ruiu updated this revision to Diff 59748.Jun 6 2016, 10:32 AM
ruiu edited edge metadata.
  • Added a check for stream size.
zturner accepted this revision.Jun 6 2016, 11:33 AM
zturner edited edge metadata.
This revision is now accepted and ready to land.Jun 6 2016, 11:33 AM
This revision was automatically updated to reflect the committed changes.