[PATCH] D136395: Add the ability to verify the .debug_aranges section.

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 24 14:26:49 PDT 2022


clayborg added a comment.

I would be happy to see .debug_aranges go away, but we have toolchains that produce it incorrectly and it causes bugs in symbolizers and in debuggers if the debuggers try to use this section. Having a verifier to tell us when there are issues can also help prove that we should get rid of this section, so I believe this is actually a good reason that it should be included so we can say "look at this build, it has X number of errors in the .debug_aranges section, so this is proof we should remove it".

So we are seeing this issue with clang built binaries where we have some ranges missing in .debug_aranges, and also some ranges that are missing in the DW_AT_ranges of the DW_TAG_compile_unit. So this is also a good way to check that the DW_AT_ranges of the compile unit are ok. To make matters worse, we also are seeing some line table entries that are not in either the .debug_ranges _or_ the DW_AT_ranges of the DW_TAG_compile_unit. That is really bad.

Having a complete DWARF verifier is my goal for this tool as there is no tool provided by the DWARF group that does any verification, and we have compilers, linkers and post production tools that modify and emit DWARF and often times the DWARF is in really bad shape, but it gets shipped and then all of the tools that try to consume this DWARF is left with trying to do their best with DWARF that is anywhere from perfect to really bad.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D136395/new/

https://reviews.llvm.org/D136395



More information about the llvm-commits mailing list