[DebugInfo] Separate fields with commas in headers of compile units (2/3).

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
This commit is contained in:
Igor Kudrin 2020-06-01 15:56:28 +07:00
parent 937403d684
commit 2a7af30482
15 changed files with 39 additions and 39 deletions

View File

@ -18,14 +18,14 @@ void DWARFCompileUnit::dump(raw_ostream &OS, DIDumpOptions DumpOpts) {
int OffsetDumpWidth = 2 * dwarf::getDwarfOffsetByteSize(getFormat());
OS << format("0x%08" PRIx64, getOffset()) << ": Compile 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());
<< ", addr_size = " << format("0x%02x", getAddressByteSize());
if (getVersion() >= 5 && getUnitType() != dwarf::DW_UT_compile)
OS << " DWO_id = " << format("0x%016" PRIx64, *getDWOId());
OS << ", DWO_id = " << format("0x%016" PRIx64, *getDWOId());
OS << " (next unit at " << format("0x%08" PRIx64, getNextUnitOffset())
<< ")\n";

View File

@ -38,7 +38,7 @@
; the length of the header.
;
; SINGLE-4: .debug_info contents:
; SINGLE-4: 0x00000000: Compile Unit: {{.*}} version = 0x0004 abbr_offset
; SINGLE-4: 0x00000000: Compile Unit: {{.*}} version = 0x0004, abbr_offset
; SINGLE-4: 0x0000000b: DW_TAG_compile_unit
;
; SINGLE-4: .debug_types contents:
@ -48,11 +48,11 @@
; Verify the v4 split headers.
;
; O-4: .debug_info contents:
; O-4: 0x00000000: Compile Unit: {{.*}} version = 0x0004 abbr_offset
; O-4: 0x00000000: Compile Unit: {{.*}} version = 0x0004, abbr_offset
; O-4: 0x0000000b: DW_TAG_compile_unit
;
; DWO-4: .debug_info.dwo contents:
; DWO-4: 0x00000000: Compile Unit: {{.*}} version = 0x0004 abbr_offset
; DWO-4: 0x00000000: Compile Unit: {{.*}} version = 0x0004, abbr_offset
; DWO-4: 0x0000000b: DW_TAG_compile_unit
;
; DWO-4: .debug_types.dwo contents:
@ -67,20 +67,20 @@
; 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
; SINGLE-5: 0x00000000: Compile Unit: {{.*}} version = 0x0005, unit_type = DW_UT_compile, abbr_offset
; SINGLE-5: 0x0000000c: DW_TAG_compile_unit
; Verify the v5 split headers.
;
; O-5: .debug_info contents:
; O-5: 0x00000000: Compile Unit: {{.*}} version = 0x0005 unit_type = DW_UT_skeleton abbr_offset
; O-5: 0x00000000: Compile Unit: {{.*}} version = 0x0005, unit_type = DW_UT_skeleton, abbr_offset
; O-5-SAME: DWO_id = 0xccd7e58ef8bf4aa6
; 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: 0x00000018: DW_TAG_type_unit
; DWO-5: 0x00000033: Compile Unit: {{.*}} version = 0x0005 unit_type = DW_UT_split_compile abbr_offset
; DWO-5: 0x00000033: Compile Unit: {{.*}} version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset
; DWO-5-SAME: DWO_id = 0xccd7e58ef8bf4aa6
; DWO-5: 0x00000047: DW_TAG_compile_unit

View File

@ -2,7 +2,7 @@
; RUN: llvm-dwarfdump %t | FileCheck %s
; Make sure we are generating DWARF version 3 when module flag says so.
; CHECK: Compile Unit: length = {{.*}} version = 0x0003
; CHECK: Compile Unit: length = {{.*}}, version = 0x0003
define i32 @main() #0 !dbg !4 {
entry:

View File

@ -76,7 +76,7 @@ CU_5_version:
CU_5_end:
# CHECK-LABEL: .debug_info contents:
# CHECK: 0x00000000: Compile Unit: length = 0x00000016 version = 0x0005 unit_type = DW_UT_compile abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x0000001a)
# CHECK: 0x00000000: Compile Unit: length = 0x00000016, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x0000001a)
# CHECK: 0x0000000c: DW_TAG_compile_unit
# CHECK-NEXT: DW_AT_producer {{.*}} "Handmade DWARF producer"
# CHECK-NEXT: DW_AT_name {{.*}} "V5_compile_unit"

View File

@ -107,7 +107,7 @@ CU_4_version:
.byte 0 # NULL
CU_4_end:
# CHECK: 0x00000000: Compile Unit: length = 0x00000015 version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x00000019)
# CHECK: 0x00000000: Compile Unit: length = 0x00000015, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000019)
# CHECK: 0x0000000b: DW_TAG_compile_unit
# DWARF v5 normal CU header.
@ -125,7 +125,7 @@ CU_5_version:
.byte 0 # NULL
CU_5_end:
# CHECK: 0x00000019: Compile Unit: length = 0x00000016 version = 0x0005 unit_type = DW_UT_compile abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x00000033)
# CHECK: 0x00000019: Compile Unit: length = 0x00000016, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000033)
# CHECK: 0x00000025: DW_TAG_compile_unit
.section .debug_info.dwo,"e",@progbits
@ -147,7 +147,7 @@ CU_split_5_version:
.byte 0 # NULL
CU_split_5_end:
# CHECK: 0x00000000: Compile Unit: length = 0x0000001e version = 0x0005 unit_type = DW_UT_split_compile abbr_offset = 0x0000 addr_size = 0x08 DWO_id = 0x000000000000005a (next unit at 0x00000022)
# CHECK: 0x00000000: Compile Unit: length = 0x0000001e, version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset = 0x0000, addr_size = 0x08, DWO_id = 0x000000000000005a (next unit at 0x00000022)
# CHECK: 0x00000014: DW_TAG_compile_unit
# CHECK-NEXT: DW_AT_producer {{.*}} "Handmade DWO producer"
# CHECK-NEXT: DW_AT_name {{.*}} "V5_dwo_compile_unit"

View File

@ -10,7 +10,7 @@ CHECK: .debug_abbrev contents
// the decompression correctly and result is the same. This and above also checks
// that sections names are properly shown in zlib-gnu style (without additional 'z' prefix).
CHECK: .debug_info contents
CHECK: 0x00000000: Compile Unit: length = 0x00000144 version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x00000148)
CHECK: 0x00000000: Compile Unit: length = 0x00000144, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000148)
// Also check that relocations in the .zdebug sections are handled correctly:
CHECK: DW_AT_ranges {{.*}} (0x00000000{{$}}

View File

@ -1,7 +1,7 @@
; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
; CHECK: .debug_info contents:
; CHECK-NEXT: 0x00000000: Compile Unit: length = 0x0000006e version = 0x0004 abbr_offset = 0x0000 addr_size = 0x04 (next unit at 0x00000072)
; CHECK-NEXT: 0x00000000: Compile Unit: length = 0x0000006e, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x04 (next unit at 0x00000072)
; CHECK: 0x0000000b: DW_TAG_compile_unit
; CHECK-NEXT: DW_AT_producer ("clang version 6.0.0 (trunk 315924) (llvm/trunk 315960)")

View File

@ -1,6 +1,6 @@
RUN: dsymutil --update -f %p/../Inputs/empty-CU.o -o - | llvm-dwarfdump -v - -debug-info | FileCheck %s
CHECK: .debug_info contents:
CHECK: 0x00000000: Compile Unit: length = 0x00000008 version = 0x0003 abbr_offset = 0x0000 addr_size = 0x04 (next unit at 0x0000000c)
CHECK: 0x00000000: Compile Unit: length = 0x00000008, version = 0x0003, abbr_offset = 0x0000, addr_size = 0x04 (next unit at 0x0000000c)
CHECK: 0x0000000b: DW_TAG_compile_unit [1]

View File

@ -15,14 +15,14 @@ objects:
...
.debug_info contents:
CHECK: Compile Unit: length = 0x0000007d version = 0x0002 abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x00000081)
CHECK: Compile Unit: length = 0x0000007d, version = 0x0002, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000081)
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_name {{.*}} "basic1.c"
CHECK: DW_TAG_subprogram
DW_AT_name {{.*}} "main"
CHECK: 0x00000081: Compile Unit: length = 0x00000089 version = 0x0002 abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x0000010e)
CHECK: 0x00000081: Compile Unit: length = 0x00000089, version = 0x0002, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x0000010e)
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_name {{.*}} "basic3.c"

View File

@ -1,7 +1,7 @@
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o
# RUN: llvm-dwarfdump %t.o | FileCheck %s
# CHECK: 0x00000000: Compile Unit: length = 0x00000009 version = 0x0005 unit_type = DW_UT_compile abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x0000000d)
# CHECK: 0x00000000: Compile Unit: length = 0x00000009, version = 0x0005, unit_type = DW_UT_compile, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x0000000d)
# CHECK: 0x0000000c: DW_TAG_compile_unit
.section .debug_abbrev,"",@progbits

View File

@ -20,7 +20,7 @@
# RUN: | llvm-dwarfdump -lookup=0x14 - | \
# RUN: FileCheck %s -check-prefixes=CHECK,C
# CHECK: Compile Unit: length = 0x00000060 version = 0x0004 abbr_offset = 0x0000 addr_size = 0x08 (next unit at 0x00000064)
# CHECK: Compile Unit: length = 0x00000060, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x00000064)
# CHECK: DW_TAG_compile_unit
# CHECK: DW_AT_name ("foo.c")

View File

@ -61,25 +61,25 @@ CHECK: DW_TAG_subprogram
CHECK: .debug_info.dwo contents:
CHECK: [[AOFF:0x[0-9a-f]*]]:
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_name {{.*}} "c.cpp"
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name {{.*}} "c"
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_name {{.*}} "e.cpp"
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name {{.*}} "e"
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_name {{.*}} "a.cpp"
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name {{.*}} "a"
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_name {{.*}} "b.cpp"
CHECK: DW_TAG_subprogram
@ -87,7 +87,7 @@ CHECK: DW_AT_name {{.*}} "b"
CHECK: DW_TAG_subprogram
CHECK: DW_AT_name {{.*}} "main"
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_name {{.*}} "d.cpp"
CHECK: DW_TAG_subprogram

View File

@ -6,7 +6,7 @@
# RUN: llvm-dwarfdump -v %t.dwp | FileCheck %s
#CHECK-DAG: .debug_info.dwo contents:
#CHECK: 0x00000000: Compile Unit: length = 0x00000050 version = 0x0005 unit_type = DW_UT_split_compile abbr_offset = 0x0000 addr_size = 0x08 DWO_id = [[DWOID:.*]] (next unit at 0x00000054)
#CHECK: 0x00000000: Compile Unit: length = 0x00000050, 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

View File

@ -27,16 +27,16 @@ CHECK: 0x0000[[BAOFF:.*]]
CHECK: .debug_info.dwo contents:
CHECK: [[COFF:0x[0-9a-f]*]]:
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004 abbr_offset =
CHECK: 0x[[CAOFF]] addr_size = 0x08 (next unit at [[AOFF:.*]])
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
CHECK: 0x[[CAOFF]], addr_size = 0x08 (next unit at [[AOFF:.*]])
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOC:.*]])
CHECK: [[AOFF]]:
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004 abbr_offset =
CHECK: 0x[[AAOFF]] addr_size = 0x08 (next unit at [[BOFF:.*]])
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
CHECK: 0x[[AAOFF]], addr_size = 0x08 (next unit at [[BOFF:.*]])
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOA:.*]])
CHECK: [[BOFF]]:
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004 abbr_offset =
CHECK: 0x[[BAOFF]] addr_size = 0x08 (next unit at [[XOFF:.*]])
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
CHECK: 0x[[BAOFF]], addr_size = 0x08 (next unit at [[XOFF:.*]])
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOB:.*]])
CHECK-LABEL: .debug_cu_index

View File

@ -29,8 +29,8 @@ CHECK: DW_TAG_formal_parameter
CHECK: .debug_info.dwo contents:
CHECK: [[AOFF:0x[0-9a-f]*]]:
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004 abbr_offset =
CHECK: 0x[[AAOFF]] addr_size = 0x08 (next unit at [[BOFF:.*]])
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
CHECK: 0x[[AAOFF]], addr_size = 0x08 (next unit at [[BOFF:.*]])
CHECK: DW_TAG_compile_unit
CHECK: DW_AT_name {{.*}} "a.cpp"
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOA:.*]])
@ -41,8 +41,8 @@ NOTYP: DW_AT_name {{.*}} "foo"
TYPES: DW_AT_signature {{.*}} ([[FOOSIG:.*]])
CHECK: [[BOFF]]:
CHECK-LABEL: Compile Unit: length = {{.*}} version = 0x0004 abbr_offset =
CHECK: 0x[[BAOFF]] addr_size = 0x08 (next unit at [[XOFF:.*]])
CHECK-LABEL: Compile Unit: length = {{.*}}, version = 0x0004, abbr_offset =
CHECK: 0x[[BAOFF]], addr_size = 0x08 (next unit at [[XOFF:.*]])
CHECK: DW_AT_name {{.*}} "b.cpp"
CHECK: DW_AT_GNU_dwo_id {{.*}} ([[DWOB:.*]])
CHECK: DW_TAG_structure_type