This is an archive of the discontinued LLVM Phabricator instance.

Dump MSF headers to YAML
ClosedPublic

Authored by zturner on Jun 3 2016, 10:42 AM.

Details

Summary

This introduces the YAML output style and implements dumping of the MSF headers to YAML. This is the smallest possible patch to get basic support for YAML output working. After I confirm I'm using the library correctly and that the code I've written is sufficiently "yamlish" (like pythonic), I'll iterate more quickly with post commit reviews.

Output looks like this currently:

D:\src\llvmbuild\ninja>bin\llvm-pdbdump.exe -raw-headers -raw-output-style=YAML d:\FileCheck.pdb
---
MSF:
  BlockSize:       4096
  Unknown0:        1
  NumBlocks:       1767
  NumDirectoryBytes: 6728
  Unknown1:        0
  BlockMapAddr:    1558
  NumDirectoryBlocks: 2
  BlockMapOffset:  6381568
  DirectoryBlocks:
    - 1556
    - 1557
  NumStreams:      131
...

Diff Detail

Repository
rL LLVM

Event Timeline

zturner updated this revision to Diff 59579.Jun 3 2016, 10:42 AM
zturner retitled this revision from to Dump MSF headers to YAML.
zturner updated this object.
zturner added reviewers: rnk, ruiu, majnemer.
zturner added a subscriber: llvm-commits.
ruiu edited edge metadata.Jun 3 2016, 11:01 AM

Can you add a (smallest possible) test as well?

I debated over whether it was worth it. The reason for doing all this is to enable new tests, and in writing those new tests (once this is complete), we should find bugs in the yaml output format as well.

I don't mind adding one tests that just checks these 5 fields, but I don't think it should turn into something comprehensive like pdbdump-headers.text where we test every single possible output path, because it seems like a lot of work for little gain.

ruiu added a comment.Jun 3 2016, 11:20 AM

OK, but having absolutely no test makes me nervous. I'd appreciate if you add a test for the five fields.

This revision was automatically updated to reflect the committed changes.