[DebugInfo] Separate fields with commas in headers of type units (3/3).
authorIgor Kudrin <ikudrin@accesssoftek.com>
Mon, 1 Jun 2020 08:57:23 +0000 (15:57 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Mon, 1 Jun 2020 10:40:28 +0000 (17:40 +0700)
For most tables, we already use commas in headers. This set of patches
unifies dumping the remaining ones.

Differential Revision: https://reviews.llvm.org/D80806

llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
llvm/test/CodeGen/X86/dwarf-headers.ll
llvm/test/CodeGen/X86/dwarf-split-line-1.ll
llvm/test/DebugInfo/X86/dwarfdump-header.s
llvm/test/DebugInfo/dwarfdump-type-units.test
llvm/test/DebugInfo/typeunit-header.test
llvm/test/tools/llvm-dwp/X86/simple.test
llvm/test/tools/llvm-dwp/X86/type_dedup.test

index 1873e22..c06c20b 100644 (file)
@@ -24,23 +24,23 @@ void DWARFTypeUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {
 
   if (DumpOpts.SummarizeTypes) {
     OS << "name = '" << Name << "'"
-       << " type_signature = " << format("0x%016" PRIx64, getTypeHash())
-       << " length = " << format("0x%0*" PRIx64, OffsetDumpWidth, getLength())
+       << ", type_signature = " << format("0x%016" PRIx64, getTypeHash())
+       << ", length = " << format("0x%0*" PRIx64, OffsetDumpWidth, getLength())
        << '\n';
     return;
   }
 
   OS << format("0x%08" PRIx64, getOffset()) << ": Type Unit:"
      << " length = " << format("0x%0*" PRIx64, OffsetDumpWidth, getLength())
-     << " version = " << format("0x%04x", getVersion());
+     << ", version = " << format("0x%04x", getVersion());
   if (getVersion() >= 5)
-    OS << " unit_type = " << dwarf::UnitTypeString(getUnitType());
-  OS << " abbr_offset = "
+    OS << ", unit_type = " << dwarf::UnitTypeString(getUnitType());
+  OS << ", abbr_offset = "
      << format("0x%04" PRIx64, getAbbreviations()->getOffset())
-     << " addr_size = " << format("0x%02x", getAddressByteSize())
-     << " name = '" << Name << "'"
-     << " type_signature = " << format("0x%016" PRIx64, getTypeHash())
-     << " type_offset = " << format("0x%04" PRIx64, getTypeOffset())
+     << ", addr_size = " << format("0x%02x", getAddressByteSize())
+     << ", name = '" << Name << "'"
+     << ", type_signature = " << format("0x%016" PRIx64, getTypeHash())
+     << ", type_offset = " << format("0x%04" PRIx64, getTypeOffset())
      << " (next unit at " << format("0x%08" PRIx64, getNextUnitOffset())
      << ")\n";
 
index 2be7fc7..4c029de 100644 (file)
@@ -42,7 +42,7 @@
 ; SINGLE-4: 0x0000000b: DW_TAG_compile_unit
 ;
 ; SINGLE-4: .debug_types contents:
-; SINGLE-4: 0x00000000: Type Unit: {{.*}} version = 0x0004 abbr_offset
+; SINGLE-4: 0x00000000: Type Unit: {{.*}} version = 0x0004, abbr_offset
 ; SINGLE-4: 0x00000017: DW_TAG_type_unit
 
 ; Verify the v4 split headers.
@@ -56,7 +56,7 @@
 ; DWO-4: 0x0000000b: DW_TAG_compile_unit
 ;
 ; DWO-4: .debug_types.dwo contents:
-; DWO-4: 0x00000000: Type Unit: {{.*}} version = 0x0004 abbr_offset
+; DWO-4: 0x00000000: Type Unit: {{.*}} version = 0x0004, abbr_offset
 ; DWO-4: 0x00000017: DW_TAG_type_unit
 
 ; Verify the v5 non-split headers. Type units come first.
@@ -64,7 +64,7 @@
 ; each new section.
 ;
 ; SINGLE-5: .debug_info contents:
-; SINGLE-5: 0x00000000: Type Unit: {{.*}} version = 0x0005 unit_type = DW_UT_type abbr_offset
+; SINGLE-5: 0x00000000: Type Unit: {{.*}} version = 0x0005, unit_type = DW_UT_type, abbr_offset
 ; SINGLE-5: 0x00000018: DW_TAG_type_unit
 ; SINGLE-5-NOT: contents:
 ; SINGLE-5: 0x00000000: Compile Unit: {{.*}} version = 0x0005, unit_type = DW_UT_compile, abbr_offset
@@ -78,7 +78,7 @@
 ; O-5: 0x00000014: DW_TAG_skeleton_unit 
 ;
 ; DWO-5: .debug_info.dwo contents:
-; DWO-5: 0x00000000: Type Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_type abbr_offset
+; DWO-5: 0x00000000: Type Unit: {{.*}} version = 0x0005, unit_type = DW_UT_split_type, abbr_offset
 ; DWO-5: 0x00000018: DW_TAG_type_unit
 ; DWO-5: 0x00000033: Compile Unit: {{.*}} version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset
 ; DWO-5-SAME:        DWO_id = 0xccd7e58ef8bf4aa6
index cdc3e20..d57c0b6 100644 (file)
@@ -8,7 +8,7 @@
 
 ; CHECK-NOT: .debug_line.dwo
 ; CHECK: .debug_info.dwo contents:
-; CHECK: 0x00000000: Type Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_type abbr_offset
+; CHECK: 0x00000000: Type Unit: {{.*}} version = 0x0005, unit_type = DW_UT_split_type, abbr_offset
 ; CHECK: 0x00000018: DW_TAG_type_unit
 ; CHECK-NOT: DW_AT_stmt_list
 ; CHECK-NOT: DW_AT_decl_file
index c2f425a..6b40c99 100644 (file)
@@ -181,7 +181,7 @@ TU_split_5_type:
         .byte 0 # NULL
 TU_split_5_end:
 
-# CHECK: 0x00000000: Type Unit: length = 0x00000020 version = 0x0005 unit_type = DW_UT_split_type abbr_offset = 0x0000 addr_size = 0x08 name = 'V5_split_type_unit' type_signature = 0x8899aabbccddeeff type_offset = 0x001d (next unit at 0x00000024)
+# CHECK: 0x00000000: Type Unit: length = 0x00000020, version = 0x0005, unit_type = DW_UT_split_type, abbr_offset = 0x0000, addr_size = 0x08, name = 'V5_split_type_unit', type_signature = 0x8899aabbccddeeff, type_offset = 0x001d (next unit at 0x00000024)
 # CHECK: 0x00000018: DW_TAG_type_unit
 
         .section .debug_types,"",@progbits
@@ -207,7 +207,7 @@ TU_4_type:
         .byte 0 # NULL
 TU_4_end:
 
-# CHECK: 0x00000000: Type Unit: length = 0x0000001f version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 name = 'V4_type_unit' type_signature = 0x0011223344556677 type_offset = 0x001c (next unit at 0x00000023)
+# CHECK: 0x00000000: Type Unit: length = 0x0000001f, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08, name = 'V4_type_unit', type_signature = 0x0011223344556677, type_offset = 0x001c (next unit at 0x00000023)
 # CHECK: 0x00000017: DW_TAG_type_unit
 
         .section .debug_line,"",@progbits
index a8876a6..9f9efc5 100644 (file)
@@ -18,7 +18,7 @@ CHECK: debug_types contents:
 LONG: 0x00000000: Type Unit: {{.*}} name =
 SHORT-NOT: Type Unit
 SHORT: name =
-CHECK-SAME: 'bar' type_signature = [[BAR_SIG]]
+CHECK-SAME: 'bar', type_signature = [[BAR_SIG]]
 SHORT-SAME: length =
 LONG-SAME: type_offset = 0x[[BAR_OFF:[0-9a-f]*]] (next unit at
 LONG: DW_TAG_type_unit
@@ -28,7 +28,7 @@ LONG-NEXT: DW_AT_name {{.*}}"bar"
 
 LONG: 0x00000000: Type Unit: {{.*}} name =
 SHORT: name =
-CHECK-SAME: 'foo' type_signature = [[FOO_SIG]]
+CHECK-SAME: 'foo', type_signature = [[FOO_SIG]]
 LONG-SAME: type_offset = 0x[[FOO_OFF:[0-9a-f]*]] (next unit at
 LONG: DW_TAG_type_unit
 LONG-NOT: NULL
index a8d3f47..e73cc6c 100644 (file)
@@ -10,6 +10,6 @@ We make sure that llvm-dwarfdump is parsing the type unit header correctly
 and displays it. 
 
 CHECK: .debug_types contents:
-CHECK: 0x00000000: Type Unit: length = 0x00000019 version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 name = '' type_signature = 0x0011223344556677 type_offset = 0x0019 (next unit at 0x0000001d)
+CHECK: 0x00000000: Type Unit: length = 0x00000019, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08, name = '', type_signature = 0x0011223344556677, type_offset = 0x0019 (next unit at 0x0000001d)
 CHECK: 0x00000017: DW_TAG_type_unit [1] *
 CHECK: DW_AT_visibility [DW_FORM_data1] (DW_VIS_local)
index c53a7de..b74db32 100644 (file)
@@ -55,14 +55,14 @@ CHECK:     DW_TAG_formal_parameter
 NOTYP-NOT: .debug_types.dwo contents:
 TYPES-LABEL: .debug_types.dwo contents:
 TYPES: [[FOOUOFF:0x[0-9a-f]*]]:
-TYPES-LABEL: Type Unit: length = 0x00000020 version = 0x0004 abbr_offset =
-TYPES:         0x[[AAOFF]] addr_size = 0x08 name = 'foo' type_signature = [[FOOSIG]] type_offset = 0x[[FOOOFF:.*]] (next unit at [[BARUOFF:.*]])
+TYPES-LABEL: Type Unit: length = 0x00000020, version = 0x0004, abbr_offset =
+TYPES:         0x[[AAOFF]], addr_size = 0x08, name = 'foo', type_signature = [[FOOSIG]], type_offset = 0x[[FOOOFF:.*]] (next unit at [[BARUOFF:.*]])
 TYPES:             DW_TAG_type_unit
 TYPES: [[FOOOFF]]:   DW_TAG_structure_type
 TYPES:                 DW_AT_name {{.*}} "foo"
 TYPES: [[BARUOFF]]:
-TYPES-LABEL: Type Unit: length = 0x00000020 version = 0x0004 abbr_offset =
-TYPES:         0x[[BAOFF]] addr_size = 0x08 name = 'bar' type_signature = [[BARSIG]] type_offset = 0x001e (next unit at [[XUOFF:.*]])
+TYPES-LABEL: Type Unit: length = 0x00000020, version = 0x0004, abbr_offset =
+TYPES:         0x[[BAOFF]], addr_size = 0x08, name = 'bar', type_signature = [[BARSIG]], type_offset = 0x001e (next unit at [[XUOFF:.*]])
 TYPES:             DW_TAG_type_unit
 TYPES: 0x00000042:   DW_TAG_structure_type
 TYPES:                 DW_AT_name {{.*}} "bar"
index 666db0f..d7044d0 100644 (file)
@@ -18,20 +18,20 @@ b.cpp:
 
 CHECK-LABEL: .debug_types.dwo contents:
 CHECK: [[COMMONUOFF:0x[0-9a-f]*]]:
-CHECK-LABEL: Type Unit: length = 0x00000020 version = 0x0004 abbr_offset =
-CHECK:         0x0000 addr_size = 0x08 name = 'common' type_signature = [[COMMONSIG:0x[0-9a-f]*]] type_offset = 0x[[COMMONOFF:.*]] (next unit at [[AUOFF:.*]])
+CHECK-LABEL: Type Unit: length = 0x00000020, version = 0x0004, abbr_offset =
+CHECK:         0x0000, addr_size = 0x08, name = 'common', type_signature = [[COMMONSIG:0x[0-9a-f]*]], type_offset = 0x[[COMMONOFF:.*]] (next unit at [[AUOFF:.*]])
 CHECK:                DW_TAG_type_unit
 CHECK: [[COMMONOFF]]:   DW_TAG_structure_type
 CHECK:                    DW_AT_name {{.*}} "common"
 CHECK: [[AUOFF]]:
-CHECK-LABEL: Type Unit: length = 0x00000020 version = 0x0004 abbr_offset =
-CHECK:         0x0000 addr_size = 0x08 name = 'adistinct' type_signature = [[ASIG:0x[0-9a-f]*]] type_offset = 0x[[AOFF:.*]] (next unit at [[BUOFF:.*]])
+CHECK-LABEL: Type Unit: length = 0x00000020, version = 0x0004, abbr_offset =
+CHECK:         0x0000, addr_size = 0x08, name = 'adistinct', type_signature = [[ASIG:0x[0-9a-f]*]], type_offset = 0x[[AOFF:.*]] (next unit at [[BUOFF:.*]])
 CHECK:             DW_TAG_type_unit
 CHECK: 0x00000042:   DW_TAG_structure_type
 CHECK:                 DW_AT_name {{.*}} "adistinct"
 CHECK: [[BUOFF]]:
-CHECK-LABEL: Type Unit: length = 0x00000020 version = 0x0004 abbr_offset =
-CHECK:         0x{{.*}} addr_size = 0x08 name = 'bdistinct' type_signature = [[BSIG:0x[0-9a-f]*]] type_offset = 0x[[BOFF:.*]] (next unit at [[XUOFF:.*]])
+CHECK-LABEL: Type Unit: length = 0x00000020, version = 0x0004, abbr_offset =
+CHECK:         0x{{.*}}, addr_size = 0x08, name = 'bdistinct', type_signature = [[BSIG:0x[0-9a-f]*]], type_offset = 0x[[BOFF:.*]] (next unit at [[XUOFF:.*]])
 CHECK:             DW_TAG_type_unit
 CHECK: 0x00000066:   DW_TAG_structure_type
 CHECK:                 DW_AT_name {{.*}} "bdistinct"