This patch adds a verification check on the abbreviation declarations in the .debug_abbrev section.
The check makes sure that no abbreviation declaration has more than one attributes with the same name.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/DebugInfo/DWARF/DWARFVerifier.cpp | ||
---|---|---|
97–105 ↗ | (On Diff #107370) | While this is really simple, I feel like it's also really overkill to build a set for every DIE. Every DIE using the same abbreviation number will expose the same issue. Can we somehow prevent the duplicated work? |
test/tools/llvm-dwarfdump/X86/verify_debug_info.s | ||
84 ↗ | (On Diff #107370) | By adding this just to the abrrev table, I think you completely break the DIE tree decoding. Wouldn't it be better to add it to the debug_info section as well? |
include/llvm/DebugInfo/DWARF/DWARFVerifier.h | ||
---|---|---|
60 ↗ | (On Diff #107370) | separate commit and perhaps use the opportunity to document verifyUnitContents? (no need for separate review) |
lib/DebugInfo/DWARF/DWARFVerifier.cpp | ||
97–105 ↗ | (On Diff #107370) | Could we iterate over the abbreviations instead of the DIEs? |
Ideally, yes (as well as other sections from the split dwarf5 proposal).
So far I've focused on verifications for/related to the .debug_info section.
Is it the case that we may need abbreviation declarations for .debug_info section from .debug_abbrev.dwo?
test/tools/llvm-dwarfdump/X86/verify_debug_info.s | ||
---|---|---|
84 ↗ | (On Diff #107370) | Sorry, I thought this was an insertion, but now I see that you replaced an attribute with one with a equivalent form. This LGTM, thanks! |
I'll +1 Paul's comment - seems worthwhile generalizing things across .dwo/non-.dwo where it's convenient/easy - otherwise we'll end up with a weirdly inconsistent verification coverage.
Is it the case that we may need abbreviation declarations for .debug_info section from .debug_abbrev.dwo?
No, .debug_abbrev.dwo would only apply to .debug_info.dwo - but pretty much any check you can do for .debug_info you should be able to do for .debug_info.dwo
I am pretty sure that any verification you want to do on .debug_abbrev would be equally applicable to .debug_abbrev.dwo; I suspect we could also verify that .debug_abbrev.dwo did not use certain forms, e.g. DW_FORM_addr, but that would be a bonus.
I went ahead with the generalization. https://reviews.llvm.org/D35698
Thanks for the feedback!