[llvm] ef7ada0 - [DebugInfo] Report the format of compilation units [3/10]

Igor Kudrin via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 2 03:57:08 PDT 2020


Author: Igor Kudrin
Date: 2020-06-02T17:55:30+07:00
New Revision: ef7ada04b187b9fb2d693cd295fd8437da17de02

URL: https://github.com/llvm/llvm-project/commit/ef7ada04b187b9fb2d693cd295fd8437da17de02
DIFF: https://github.com/llvm/llvm-project/commit/ef7ada04b187b9fb2d693cd295fd8437da17de02.diff

LOG: [DebugInfo] Report the format of compilation units [3/10]

Differential Revision: https://reviews.llvm.org/D80523

Added: 
    

Modified: 
    llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp
    llvm/test/DebugInfo/X86/dwarfdump-header-64.s
    llvm/test/DebugInfo/X86/dwarfdump-header.s
    llvm/test/DebugInfo/dwarfdump-zlib.test
    llvm/test/MC/WebAssembly/dwarfdump.ll
    llvm/test/tools/dsymutil/X86/empty-CU.test
    llvm/test/tools/dsymutil/X86/generate-empty-CU.test
    llvm/test/tools/llvm-dwarfdump/X86/debug_info_min_dwarf64.s
    llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_nouse.s
    llvm/test/tools/llvm-dwarfdump/X86/lookup.s
    llvm/test/tools/llvm-dwp/X86/info-v5.s

Removed: 
    


################################################################################
diff  --git a/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp
index 5eb33022a968..9bd134105c9b 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp
@@ -18,6 +18,7 @@ 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())
+     << ", 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-64.s b/llvm/test/DebugInfo/X86/dwarfdump-header-64.s
index cbe436a74bc6..6f3cf691dc34 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-header-64.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-header-64.s
@@ -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, format = DWARF32, 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
index 6b40c99736fe..024b4bd06a71 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-header.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-header.s
@@ -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, format = DWARF32, 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, format = DWARF32, 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", at 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, format = DWARF32, 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
index 3abb8d5c89a2..2fa904d543ae 100644
--- a/llvm/test/DebugInfo/dwarfdump-zlib.test
+++ b/llvm/test/DebugInfo/dwarfdump-zlib.test
@@ -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, format = DWARF32, 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
index 7e2c682a3104..e6b3f15ba414 100644
--- 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, format = DWARF32, 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
index f33f1a54d651..bd3a54491ae6 100644
--- 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, format = DWARF32, 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
index 53baa6789cf5..58afea183a2f 100644
--- a/llvm/test/tools/dsymutil/X86/generate-empty-CU.test
+++ b/llvm/test/tools/dsymutil/X86/generate-empty-CU.test
@@ -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, format = DWARF32, 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, format = DWARF32, 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_info_min_dwarf64.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_info_min_dwarf64.s
index 5c1d752ad2bf..93de3a7a5918 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_info_min_dwarf64.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_info_min_dwarf64.s
@@ -19,6 +19,7 @@ DI_4_64_start:
         .long 0xffffffff       # DWARF64 mark
         .quad DI_4_64_end - DI_4_64_version # Length of Unit
 # CHECK-SAME: length = 0x000000000000000f
+# CHECK-SAME: format = DWARF64
 DI_4_64_version:
         .short 4               # DWARF version number
 # CHECK-SAME: version = 0x0004

diff  --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_nouse.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_loclists_nouse.s
index 384652516e72..54946e135a10 100644
--- 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, format = DWARF32, 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,"", at progbits

diff  --git a/llvm/test/tools/llvm-dwarfdump/X86/lookup.s b/llvm/test/tools/llvm-dwarfdump/X86/lookup.s
index dc1fb77f072b..74f3314a4f4e 100644
--- 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, format = DWARF32, 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/info-v5.s b/llvm/test/tools/llvm-dwp/X86/info-v5.s
index e9797d49590d..22da132e6d21 100644
--- 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, format = DWARF32, 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


        


More information about the llvm-commits mailing list