diff --git a/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp --- a/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp @@ -18,14 +18,14 @@ 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"; diff --git a/llvm/test/CodeGen/X86/dwarf-headers.ll b/llvm/test/CodeGen/X86/dwarf-headers.ll --- a/llvm/test/CodeGen/X86/dwarf-headers.ll +++ b/llvm/test/CodeGen/X86/dwarf-headers.ll @@ -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 diff --git a/llvm/test/DebugInfo/Generic/version.ll b/llvm/test/DebugInfo/Generic/version.ll --- a/llvm/test/DebugInfo/Generic/version.ll +++ b/llvm/test/DebugInfo/Generic/version.ll @@ -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: diff --git a/llvm/test/DebugInfo/X86/dwarfdump-header-64.s b/llvm/test/DebugInfo/X86/dwarfdump-header-64.s --- a/llvm/test/DebugInfo/X86/dwarfdump-header-64.s +++ b/llvm/test/DebugInfo/X86/dwarfdump-header-64.s @@ -76,7 +76,7 @@ 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" diff --git a/llvm/test/DebugInfo/X86/dwarfdump-header.s b/llvm/test/DebugInfo/X86/dwarfdump-header.s --- a/llvm/test/DebugInfo/X86/dwarfdump-header.s +++ b/llvm/test/DebugInfo/X86/dwarfdump-header.s @@ -107,7 +107,7 @@ .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 @@ .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 @@ .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" diff --git a/llvm/test/DebugInfo/dwarfdump-zlib.test b/llvm/test/DebugInfo/dwarfdump-zlib.test --- a/llvm/test/DebugInfo/dwarfdump-zlib.test +++ b/llvm/test/DebugInfo/dwarfdump-zlib.test @@ -10,7 +10,7 @@ // 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{{$}} diff --git a/llvm/test/MC/WebAssembly/dwarfdump.ll b/llvm/test/MC/WebAssembly/dwarfdump.ll --- a/llvm/test/MC/WebAssembly/dwarfdump.ll +++ b/llvm/test/MC/WebAssembly/dwarfdump.ll @@ -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)") diff --git a/llvm/test/tools/dsymutil/X86/empty-CU.test b/llvm/test/tools/dsymutil/X86/empty-CU.test --- a/llvm/test/tools/dsymutil/X86/empty-CU.test +++ b/llvm/test/tools/dsymutil/X86/empty-CU.test @@ -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] diff --git a/llvm/test/tools/dsymutil/X86/generate-empty-CU.test b/llvm/test/tools/dsymutil/X86/generate-empty-CU.test --- a/llvm/test/tools/dsymutil/X86/generate-empty-CU.test +++ b/llvm/test/tools/dsymutil/X86/generate-empty-CU.test @@ -15,14 +15,14 @@ ... .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" diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_nouse.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_nouse.s --- a/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_nouse.s +++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_nouse.s @@ -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 diff --git a/llvm/test/tools/llvm-dwarfdump/X86/lookup.s b/llvm/test/tools/llvm-dwarfdump/X86/lookup.s --- a/llvm/test/tools/llvm-dwarfdump/X86/lookup.s +++ b/llvm/test/tools/llvm-dwarfdump/X86/lookup.s @@ -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") diff --git a/llvm/test/tools/llvm-dwp/X86/dwos_list_from_exec_simple.test b/llvm/test/tools/llvm-dwp/X86/dwos_list_from_exec_simple.test --- a/llvm/test/tools/llvm-dwp/X86/dwos_list_from_exec_simple.test +++ b/llvm/test/tools/llvm-dwp/X86/dwos_list_from_exec_simple.test @@ -61,25 +61,25 @@ 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_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 diff --git a/llvm/test/tools/llvm-dwp/X86/info-v5.s b/llvm/test/tools/llvm-dwp/X86/info-v5.s --- a/llvm/test/tools/llvm-dwp/X86/info-v5.s +++ b/llvm/test/tools/llvm-dwp/X86/info-v5.s @@ -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 diff --git a/llvm/test/tools/llvm-dwp/X86/merge.test b/llvm/test/tools/llvm-dwp/X86/merge.test --- a/llvm/test/tools/llvm-dwp/X86/merge.test +++ b/llvm/test/tools/llvm-dwp/X86/merge.test @@ -27,16 +27,16 @@ 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 diff --git a/llvm/test/tools/llvm-dwp/X86/simple.test b/llvm/test/tools/llvm-dwp/X86/simple.test --- a/llvm/test/tools/llvm-dwp/X86/simple.test +++ b/llvm/test/tools/llvm-dwp/X86/simple.test @@ -29,8 +29,8 @@ 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 @@ 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