[llvm] c3902b6 - [DebugInfo] Report the format of type units [10/10]
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 2 03:57:23 PDT 2020
Author: Igor Kudrin
Date: 2020-06-02T17:55:31+07:00
New Revision: c3902b62e63752edd196648f797af5f97006ae1d
URL: https://github.com/llvm/llvm-project/commit/c3902b62e63752edd196648f797af5f97006ae1d
DIFF: https://github.com/llvm/llvm-project/commit/c3902b62e63752edd196648f797af5f97006ae1d.diff
LOG: [DebugInfo] Report the format of type units [10/10]
Differential Revision: https://reviews.llvm.org/D80523
Added:
Modified:
llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
llvm/test/DebugInfo/X86/dwarfdump-header.s
llvm/test/DebugInfo/typeunit-header.test
llvm/test/tools/llvm-dwarfdump/X86/typeunit-v4-dwarf64.s
llvm/test/tools/llvm-dwarfdump/X86/typeunit-v5-dwarf64.s
llvm/test/tools/llvm-dwp/X86/simple.test
llvm/test/tools/llvm-dwp/X86/type_dedup.test
Removed:
################################################################################
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
index c06c20bbd651..c219f34bbc31 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFTypeUnit.cpp
@@ -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());
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-header.s b/llvm/test/DebugInfo/X86/dwarfdump-header.s
index 024b4bd06a71..3d1c538a8e1f 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-header.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-header.s
@@ -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,"", at 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, 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,"", at progbits
diff --git a/llvm/test/DebugInfo/typeunit-header.test b/llvm/test/DebugInfo/typeunit-header.test
index e73cc6caecf4..f32cd41f8e33 100644
--- a/llvm/test/DebugInfo/typeunit-header.test
+++ b/llvm/test/DebugInfo/typeunit-header.test
@@ -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)
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/typeunit-v4-dwarf64.s b/llvm/test/tools/llvm-dwarfdump/X86/typeunit-v4-dwarf64.s
index 6b9eff3baa9d..3077e6c5708f 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/typeunit-v4-dwarf64.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/typeunit-v4-dwarf64.s
@@ -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
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/typeunit-v5-dwarf64.s b/llvm/test/tools/llvm-dwarfdump/X86/typeunit-v5-dwarf64.s
index de07dd150f3e..d0215ff35e10 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/typeunit-v5-dwarf64.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/typeunit-v5-dwarf64.s
@@ -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
diff --git a/llvm/test/tools/llvm-dwp/X86/simple.test b/llvm/test/tools/llvm-dwp/X86/simple.test
index b74db3223110..9fb1b03f42fa 100644
--- a/llvm/test/tools/llvm-dwp/X86/simple.test
+++ b/llvm/test/tools/llvm-dwp/X86/simple.test
@@ -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
diff --git a/llvm/test/tools/llvm-dwp/X86/type_dedup.test b/llvm/test/tools/llvm-dwp/X86/type_dedup.test
index d7044d0cba5e..a59de6624997 100644
--- a/llvm/test/tools/llvm-dwp/X86/type_dedup.test
+++ b/llvm/test/tools/llvm-dwp/X86/type_dedup.test
@@ -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
More information about the llvm-commits
mailing list