Skip to content

Commit

Permalink
[DebugInfo] Separate fields with commas in headers of type units (3/3).
Browse files Browse the repository at this point in the history
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
  • Loading branch information
igorkudrin committed Jun 1, 2020
1 parent 2a7af30 commit cbec419
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 29 deletions.
18 changes: 9 additions & 9 deletions llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down
8 changes: 4 additions & 4 deletions llvm/test/CodeGen/X86/dwarf-headers.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -56,15 +56,15 @@
; 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.
; All .debug_info sections are reported in one go, but the offset resets for
; 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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/X86/dwarf-split-line-1.ll
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/DebugInfo/X86/dwarfdump-header.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/DebugInfo/dwarfdump-type-units.test
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/DebugInfo/typeunit-header.test
Original file line number Diff line number Diff line change
Expand Up @@ -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)
8 changes: 4 additions & 4 deletions llvm/test/tools/llvm-dwp/X86/simple.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
12 changes: 6 additions & 6 deletions llvm/test/tools/llvm-dwp/X86/type_dedup.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit cbec419

Please sign in to comment.