[llvm] [DWARFDump] Make --verify handle all sections by default (PR #81559)

Felipe de Azevedo Piovezan via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 08:35:16 PST 2024


felipepiovezan wrote:

 > It's possible that this is valid DWARF and the verifier is being overly pedantic. This would be a tail merging operation - I don't think LLVM does this, but it's possible that other producers do?

The spec doesn't say anything, only that strps must point to some offset inside the string table. If we interpret this literally, it would be valid DWARF indeed. I see no reason to disallow that 🤔 

Looking into the commit history and... you're the one who implemented this check! :) You actually point this out in the commit description (5e74b2e8bb9b191aa5ed433820860b30ca7d9baa):

>  This assumes no suffix merging - if anyone implements that, then this
    checking should just be removed for the most part (we could still check
    the offsets are within the bounds of .debug_str[.dwo], but nothing more
    - any offset in the range would be valid, the offsets wouldn't have to
    land at the start of a string)

It curious because the affected test -- if we are to believe the comments there -- was generated by Clang... I tried to generate its binary inputs again, but found a crash in Clang's handling of debug macros, so I decided to put it off for now and just disable the verifier for that check; this should be fine, the test is not focused in debug strings.

https://github.com/llvm/llvm-project/pull/81559


More information about the llvm-commits mailing list