[llvm] 5146fc1 - llvm-dwarfdump: Include unit count in DWP index header dumping

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 12:40:28 PDT 2020


Author: David Blaikie
Date: 2020-06-12T12:40:02-07:00
New Revision: 5146fc15fceabf238f4a9617160001248c56a796

URL: https://github.com/llvm/llvm-project/commit/5146fc15fceabf238f4a9617160001248c56a796
DIFF: https://github.com/llvm/llvm-project/commit/5146fc15fceabf238f4a9617160001248c56a796.diff

LOG: llvm-dwarfdump: Include unit count in DWP index header dumping

And add comma separators (to be consistent with recent
changes/improvements to the dumping of other section headers) while I'm
here.

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
    llvm/test/DebugInfo/X86/debug-cu-index-unknown-section.s
    llvm/test/DebugInfo/X86/dwp-v2-cu-index.s
    llvm/test/DebugInfo/X86/dwp-v2-tu-index.s
    llvm/test/DebugInfo/X86/dwp-v5-cu-index.s
    llvm/test/DebugInfo/X86/dwp-v5-tu-index.s
    llvm/test/DebugInfo/dwarfdump-dwp.test
    llvm/test/tools/llvm-dwp/X86/info-v5.s
    llvm/test/tools/llvm-dwp/X86/unknown-section-id.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
index f783d47b3691..3d4cecce27db 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFUnitIndex.cpp
@@ -112,7 +112,7 @@ bool DWARFUnitIndex::Header::parse(DataExtractor IndexData,
 }
 
 void DWARFUnitIndex::Header::dump(raw_ostream &OS) const {
-  OS << format("version = %u slots = %u\n\n", Version, NumBuckets);
+  OS << format("version = %u, units = %u, slots = %u\n\n", Version, NumUnits, NumBuckets);
 }
 
 bool DWARFUnitIndex::parse(DataExtractor IndexData) {

diff  --git a/llvm/test/DebugInfo/X86/debug-cu-index-unknown-section.s b/llvm/test/DebugInfo/X86/debug-cu-index-unknown-section.s
index 147e4df2cc49..66a592cfa365 100644
--- a/llvm/test/DebugInfo/X86/debug-cu-index-unknown-section.s
+++ b/llvm/test/DebugInfo/X86/debug-cu-index-unknown-section.s
@@ -3,7 +3,7 @@
 # RUN:   FileCheck %s --strict-whitespace
 
 # CHECK:      .debug_cu_index contents:
-# CHECK-NEXT: version = 2 slots = 2
+# CHECK-NEXT: version = 2, units = 1, slots = 2
 # CHECK-EMPTY:
 # CHECK-NEXT: Index Signature          Unknown: 9               INFO
 # CHECK-NEXT: ----- ------------------ ------------------------ ------------------------

diff  --git a/llvm/test/DebugInfo/X86/dwp-v2-cu-index.s b/llvm/test/DebugInfo/X86/dwp-v2-cu-index.s
index 43d7b074bf54..e66865b0ec56 100644
--- a/llvm/test/DebugInfo/X86/dwp-v2-cu-index.s
+++ b/llvm/test/DebugInfo/X86/dwp-v2-cu-index.s
@@ -6,7 +6,7 @@
 # RUN:   FileCheck %s
 
 # CHECK:      .debug_cu_index contents:
-# CHECK-NEXT: version = 2 slots = 2
+# CHECK-NEXT: version = 2, units = 1, slots = 2
 # CHECK-EMPTY:
 # CHECK-NEXT: Index Signature          INFO                     ABBREV                   LINE                     LOC                      STR_OFFSETS              MACINFO                  MACRO
 # CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------

diff  --git a/llvm/test/DebugInfo/X86/dwp-v2-tu-index.s b/llvm/test/DebugInfo/X86/dwp-v2-tu-index.s
index 302ac7ed5186..d10bb4cef19b 100644
--- a/llvm/test/DebugInfo/X86/dwp-v2-tu-index.s
+++ b/llvm/test/DebugInfo/X86/dwp-v2-tu-index.s
@@ -6,7 +6,7 @@
 # RUN:   FileCheck %s
 
 # CHECK:      .debug_tu_index contents:
-# CHECK-NEXT: version = 2 slots = 2
+# CHECK-NEXT: version = 2, units = 1, slots = 2
 # CHECK-EMPTY:
 # CHECK-NEXT: Index Signature          TYPES                    ABBREV                   LINE                     STR_OFFSETS
 # CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------

diff  --git a/llvm/test/DebugInfo/X86/dwp-v5-cu-index.s b/llvm/test/DebugInfo/X86/dwp-v5-cu-index.s
index 0cc1ee8e87dd..6c4aac855ff9 100644
--- a/llvm/test/DebugInfo/X86/dwp-v5-cu-index.s
+++ b/llvm/test/DebugInfo/X86/dwp-v5-cu-index.s
@@ -6,7 +6,7 @@
 # RUN:   FileCheck %s
 
 # CHECK:      .debug_cu_index contents:
-# CHECK-NEXT: version = 5 slots = 2
+# CHECK-NEXT: version = 5, units = 1, slots = 2
 # CHECK-EMPTY:
 # CHECK-NEXT: Index Signature          INFO                     ABBREV                   LINE                     LOCLISTS                 STR_OFFSETS              MACRO                    RNGLISTS
 # CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------ ------------------------

diff  --git a/llvm/test/DebugInfo/X86/dwp-v5-tu-index.s b/llvm/test/DebugInfo/X86/dwp-v5-tu-index.s
index e050296cd410..0d6527701b08 100644
--- a/llvm/test/DebugInfo/X86/dwp-v5-tu-index.s
+++ b/llvm/test/DebugInfo/X86/dwp-v5-tu-index.s
@@ -6,7 +6,7 @@
 # RUN:   FileCheck %s
 
 # CHECK:      .debug_tu_index contents:
-# CHECK-NEXT: version = 5 slots = 2
+# CHECK-NEXT: version = 5, units = 1, slots = 2
 # CHECK-EMPTY:
 # CHECK-NEXT: Index Signature          INFO                     ABBREV                   LINE                     STR_OFFSETS
 # CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------

diff  --git a/llvm/test/DebugInfo/dwarfdump-dwp.test b/llvm/test/DebugInfo/dwarfdump-dwp.test
index 7d945eccf64f..0f57a513eac4 100644
--- a/llvm/test/DebugInfo/dwarfdump-dwp.test
+++ b/llvm/test/DebugInfo/dwarfdump-dwp.test
@@ -37,14 +37,14 @@ RUN: llvm-dwarfdump -v %p/Inputs/dwarfdump-dwp.x86_64.o | FileCheck %s
 ; CHECK:       DW_AT_decl_file {{.*}} ("b.cpp")
 
 ; CHECK: .debug_cu_index contents:
-; CHECK-NEXT: version = 2 slots = 16
+; CHECK-NEXT: version = 2, units = 2, slots = 16
 ; CHECK:      Index Signature          INFO                     ABBREV                   LINE                     STR_OFFSETS
 ; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
 ; CHECK-NEXT:     3 0xfef104c25502f092 [0x0000002d, 0x0000005f) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)
 ; CHECK-NEXT:     9 0x03c30756e2d45008 [0x00000000, 0x0000002d) [0x00000000, 0x00000043) [0x00000000, 0x0000001a) [0x00000000, 0x00000010)
 
 ; CHECK: .debug_tu_index contents:
-; CHECK-NEXT: version = 2 slots = 16
+; CHECK-NEXT: version = 2, units = 2, slots = 16
 ; CHECK:      Index Signature          TYPES                    ABBREV                   LINE                     STR_OFFSETS
 ; CHECK-NEXT: ----- ------------------ ------------------------ ------------------------ ------------------------ ------------------------
 ; CHECK-NEXT:     9 0x1d02f3be30cc5688 [0x00000024, 0x00000048) [0x00000043, 0x0000008e) [0x0000001a, 0x00000034) [0x00000010, 0x00000024)

diff  --git a/llvm/test/tools/llvm-dwp/X86/info-v5.s b/llvm/test/tools/llvm-dwp/X86/info-v5.s
index 22da132e6d21..c4ffdfc26010 100644
--- a/llvm/test/tools/llvm-dwp/X86/info-v5.s
+++ b/llvm/test/tools/llvm-dwp/X86/info-v5.s
@@ -9,7 +9,7 @@
 #CHECK: 0x00000000: Compile Unit: length = 0x00000050, format = DWARF32, version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset = 0x0000, addr_size = 0x08, DWO_id = [[DWOID:.*]] (next unit at 0x00000054)
 
 # CHECK-DAG: .debug_cu_index contents:
-# CHECK: version = 2 slots = 2
+# CHECK: version = 2, units = 1, slots = 2
 # CHECK: Index Signature          INFO                     ABBREV
 # CHECK: 1 [[DWOID]] [0x00000000, 0x00000054) [0x00000000, 0x0000002a)
 

diff  --git a/llvm/test/tools/llvm-dwp/X86/unknown-section-id.s b/llvm/test/tools/llvm-dwp/X86/unknown-section-id.s
index 384b58da0c6f..387dbc822b0c 100644
--- a/llvm/test/tools/llvm-dwp/X86/unknown-section-id.s
+++ b/llvm/test/tools/llvm-dwp/X86/unknown-section-id.s
@@ -13,7 +13,7 @@
 ## identifiers is copied.
 
 # CHECK:      .debug_cu_index contents:
-# CHECK-NEXT: version = 2 slots = 2
+# CHECK-NEXT: version = 2, units = 1, slots = 2
 # CHECK:      Index Signature INFO ABBREV
 # CHECK-NOT:  Unknown
 # CHECK:      -----
@@ -21,7 +21,7 @@
 # CHECK-NOT:  [
 
 # CHECK:      .debug_tu_index contents:
-# CHECK-NEXT: version = 2 slots = 2
+# CHECK-NEXT: version = 2, units = 1, slots = 2
 # CHECK:      Index Signature TYPES ABBREV
 # CHECK-NOT:  Unknown
 # CHECK:      -----


        


More information about the llvm-commits mailing list