This allows us to use yaml2obj and obj2yaml to round-trip CodeView symbol and type information without having to manually specify the bytes of the section. This makes for much easier to maintain tests. See the tests under lld/COFF in this patch for example. Before they just said SectionData: <blob> whereas now we can use meaningful record descriptions. Note that it still supports the SectionData yaml field, which could be useful for initializing a section to invalid bytes for testing, for example.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lld/test/COFF/Inputs/pdb1.yaml | ||
---|---|---|
33–34 ↗ | (On Diff #102270) | Looked into this and while I think it's technically supported by the YAML spec (What goes under a tag is defined to be "application specific", so I guess it could be anything, and example 2.24 even seems to be an exact match for what we want to do (e.g. the !shape tag followed immediately by a list)), I don't think our YAML parser supports it. In order to map a block sequence, we have to give it a name. The specification for block sequences doesn't seem to require that a block sequence have a name, but otoh the syntax used in the yaml spec is hard to make sense of, so maybe I missed something. TL;DR - Probably could do it, but non-trivial. |
I skimmed over the rest of the code, and I didn't have any major comments. Do you want to give @inglorion a chance to review, or go ahead and commit?
lld/test/COFF/Inputs/pdb1.yaml | ||
---|---|---|
33–34 ↗ | (On Diff #102270) | Oh well. |
llvm/trunk/lib/DebugInfo/CodeView/StringsAndChecksums.cpp | ||
---|---|---|
35 | In that case can I just assert if it fails? We've got a corrupt object file at that point. |
This should propagate the Error on failure, this is library code.