This is an archive of the discontinued LLVM Phabricator instance.

[llvm-pdbdump] [yaml2pdb] always include object file name in module info
ClosedPublic

Authored by inglorion on May 23 2017, 2:47 PM.

Details

Summary

Previously, the yaml2pdb subcommand of llvm-pdbdump only
included object file names in module info if a module info stream was
present. This change makes it so that we include the object file name
even if there is no module info stream for the module. As a result,
running
llvm-pdbdump pdb2yaml -dbi-module-info original.pdb > original.yaml &&
llvm-pdbdump yaml2pdb -pdb=new.pdb original.yaml && llvm-pdbdump
pdb2yaml -dbi-module-info new.pdb > new.yaml now produces identical
original.yaml and new.yaml files.

Diff Detail

Repository
rL LLVM

Event Timeline

inglorion created this revision.May 23 2017, 2:47 PM
zturner edited edge metadata.May 23 2017, 7:44 PM

Can you add a test for this? It's really easy to generate yaml -> pdb tests now, just write a yaml file with everything cut out except for the fields you care about. It should pick up default values for everything else. Take a look at test\DebugInfo\PDB\Inputs\one-symbol.yaml for an example.

inglorion updated this revision to Diff 100172.May 24 2017, 3:20 PM

added test

zturner added inline comments.May 24 2017, 4:11 PM
test/DebugInfo/PDB/pdbdump-objfilename.yaml
5–6 ↗(On Diff #100172)

Seems better to check the entire text rather than just one field, which would match regardless of what the output looked like, as long as that text appeared. How about:

CHECK:      DbiStream
CHECK-NEXT:   Modules
CHECK-NEXT:     - Module:[[ *]]'C:\src\test.obj'
CHECK-NEXT:       ObjFile:[[ *]]'C:\src\test.obj'
inglorion updated this revision to Diff 100184.May 24 2017, 4:42 PM

stricter check

inglorion marked an inline comment as done.May 24 2017, 4:44 PM
inglorion added inline comments.
test/DebugInfo/PDB/pdbdump-objfilename.yaml
5–6 ↗(On Diff #100172)

I made the check a little stricter. "Modules:" is still CHECK instead of CHECK-NEXT, because otherwise we would fail because of other fields that I don't think we care about in this test.

zturner accepted this revision.May 24 2017, 5:05 PM
This revision is now accepted and ready to land.May 24 2017, 5:05 PM
This revision was automatically updated to reflect the committed changes.
inglorion marked an inline comment as done.