Skip to content

Commit

Permalink
[DebugInfo] Report the format of type units [10/10]
Browse files Browse the repository at this point in the history
Differential Revision: https://reviews.llvm.org/D80523
  • Loading branch information
igorkudrin committed Jun 2, 2020
1 parent def6771 commit c3902b6
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void DWARFTypeUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {

OS << format("0x%08" PRIx64, getOffset()) << ": Type Unit:"
<< " length = " << format("0x%0*" PRIx64, OffsetDumpWidth, getLength())
<< ", format = " << dwarf::FormatString(getFormat())
<< ", version = " << format("0x%04x", getVersion());
if (getVersion() >= 5)
OS << ", unit_type = " << dwarf::UnitTypeString(getUnitType());
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, format = DWARF32, 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, format = DWARF32, 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
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, format = DWARF32, 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)
1 change: 1 addition & 0 deletions llvm/test/tools/llvm-dwarfdump/X86/typeunit-v4-dwarf64.s
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ TU_4_64_start:
.long 0xffffffff # DWARF64 mark
.quad TU_4_64_end-TU_4_64_version # Length of Unit
# CHECK-SAME: length = 0x0000000000000021
# CHECK-SAME: format = DWARF64
TU_4_64_version:
.short 4 # DWARF version number
# CHECK-SAME: version = 0x0004
Expand Down
1 change: 1 addition & 0 deletions llvm/test/tools/llvm-dwarfdump/X86/typeunit-v5-dwarf64.s
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ TU_5_64_start:
.long 0xffffffff # DWARF64 mark
.quad TU_5_64_end-TU_5_64_version # Length of Unit
# CHECK-SAME: length = 0x0000000000000022
# CHECK-SAME: format = DWARF64
TU_5_64_version:
.short 5 # DWARF version number
# CHECK-SAME: version = 0x0005
Expand Down
4 changes: 2 additions & 2 deletions llvm/test/tools/llvm-dwp/X86/simple.test
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ 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-LABEL: Type Unit: length = 0x00000020, format = DWARF32, 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-LABEL: Type Unit: length = 0x00000020, format = DWARF32, 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
Expand Down
6 changes: 3 additions & 3 deletions llvm/test/tools/llvm-dwp/X86/type_dedup.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ 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-LABEL: Type Unit: length = 0x00000020, format = DWARF32, 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-LABEL: Type Unit: length = 0x00000020, format = DWARF32, 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-LABEL: Type Unit: length = 0x00000020, format = DWARF32, 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
Expand Down

0 comments on commit c3902b6

Please sign in to comment.