aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
diff options
context:
space:
mode:
authorFelipe de Azevedo Piovezan <fpiovezan@apple.com>2024-02-13 13:20:25 -0800
committerGitHub <noreply@github.com>2024-02-13 13:20:25 -0800
commit52961491ca347e7c8766dc7c45841bacac6a4470 (patch)
tree32e73263dc17493e736bd180da17dcccf138539a /llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
parent2400f704af18fd4b58ded158c3debe3b295accc6 (diff)
downloadllvm-52961491ca347e7c8766dc7c45841bacac6a4470.zip
llvm-52961491ca347e7c8766dc7c45841bacac6a4470.tar.gz
llvm-52961491ca347e7c8766dc7c45841bacac6a4470.tar.bz2
[DWARFDump] Make --verify handle all sections by default (#81559)
The current behavior of --verify is that it only verifies debug_info, debug_abbrev and debug_names. This seems fairly arbitrary and might have been unintentional, as originally the absence of any section flags implied "all". This patch changes the behavior so that the verifier now verifies everything by default. It revealed two tests that had potentially invalid DWARF: 1. dwarfdump-str-offsets.s is adding padding between two debug_str_offset contributions. The standard does not explicitly allow this behavior. See issue https://github.com/llvm/llvm-project/issues/81558 2. dwarf5-macro.test uses a checked-in binary that has invalid debug_str_offsets. One of its entries points to the _middle_ of the string section: error: .debug_str_offsets: contribution 0x0: index 0x4: invalid string offset *0x18 == 0x455D, is neither zero nor immediately following a null character If we look at the closest offset to 0x455D in debug_str: ``` 0x0000454e: "__SLONG32_TYPE int" ``` 0x455D points to "int".
Diffstat (limited to 'llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp')
-rw-r--r--llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index 8cdd84b..2b438a8 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -863,7 +863,7 @@ int main(int argc, char **argv) {
if (DumpAll)
DumpType = DIDT_All;
if (DumpType == DIDT_Null) {
- if (Verbose)
+ if (Verbose || Verify)
DumpType = DIDT_All;
else
DumpType = DIDT_DebugInfo;