Skip to content

Commit 33529ba

Browse files
committed
llvm-dwarfdump --summarize-types: skip compilation units
Important for DWARFv5 debug info which might contain type units in the debug_info section, which made summarize-types fairly ineffective/lost amongst the noise of CUs being dumped.
1 parent 8ade3d4 commit 33529ba

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
using namespace llvm;
1616

1717
void DWARFCompileUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {
18+
if (DumpOpts.SummarizeTypes)
19+
return;
1820
int OffsetDumpWidth = 2 * dwarf::getDwarfOffsetByteSize(getFormat());
1921
OS << format("0x%08" PRIx64, getOffset()) << ": Compile Unit:"
2022
<< " length = " << format("0x%0*" PRIx64, OffsetDumpWidth, getLength())

llvm/test/DebugInfo/dwarfdump-type-units.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
RUN: llvm-dwarfdump -v %p/Inputs/dwarfdump-type-units.elf-x86-64 | FileCheck -check-prefix=INFO -check-prefix=CHECK -check-prefix=LONG %s
2-
RUN: llvm-dwarfdump -debug-types %p/Inputs/dwarfdump-type-units.elf-x86-64 -summarize-types | FileCheck -implicit-check-not=DW_ -check-prefix=CHECK -check-prefix=SHORT %s
2+
RUN: llvm-dwarfdump -debug-types -debug-info %p/Inputs/dwarfdump-type-units.elf-x86-64 -summarize-types | FileCheck -implicit-check-not=DW_ -check-prefix=CHECK -check-prefix=SHORT %s
33
RUN: llvm-dwarfdump -v -debug-types %p/Inputs/dwarfdump-type-units.elf-x86-64 | FileCheck -check-prefix=TYPES %s
44

55
INFO: debug_info contents:

0 commit comments

Comments
 (0)