[DebugInfo] Report the format of line tables [7/10]
authorIgor Kudrin <ikudrin@accesssoftek.com>
Tue, 2 Jun 2020 09:05:43 +0000 (16:05 +0700)
committerIgor Kudrin <ikudrin@accesssoftek.com>
Tue, 2 Jun 2020 10:55:31 +0000 (17:55 +0700)
Differential Revision: https://reviews.llvm.org/D80523

llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
llvm/test/DebugInfo/RISCV/dwarf-riscv-relocs.ll
llvm/test/DebugInfo/X86/dwarfdump-line-dwo.s
llvm/test/tools/llvm-dwarfdump/X86/debug-line.s
llvm/test/tools/llvm-dwarfdump/X86/debug_line_dwarf64_large_table.s
llvm/test/tools/llvm-dwarfdump/X86/debug_line_invalid.test

index df59416..2c1c284 100644 (file)
@@ -110,6 +110,7 @@ void DWARFDebugLine::Prologue::dump(raw_ostream &OS,
   OS << "Line table prologue:\n"
      << format("    total_length: 0x%0*" PRIx64 "\n", OffsetDumpWidth,
                TotalLength)
+     << "          format: " << dwarf::FormatString(FormParams.Format) << "\n"
      << format("         version: %u\n", getVersion());
   if (!versionIsSupported(getVersion()))
     return;
index e923810..22c5f85 100644 (file)
@@ -37,6 +37,7 @@
 ; DWARF-DUMP-NEXT: debug_line[0x00000000]
 ; DWARF-DUMP-NEXT: Line table prologue:
 ; DWARF-DUMP-NEXT:     total_length: 0x0000005f
+; DWARF-DUMP-NEXT:           format: DWARF32
 ; DWARF-DUMP-NEXT:          version: 5
 ; DWARF-DUMP-NEXT:     address_size: 4
 ; DWARF-DUMP-NEXT:  seg_select_size: 0
index d5646bf..d82c861 100644 (file)
@@ -44,6 +44,7 @@ LH_1_end:
 
 # PART1:      Line table prologue:
 # PART1-NEXT: total_length: 0x0000002e
+# PART1-NEXT: format: DWARF32
 # PART1-NEXT: version: 4
 # PART1-NEXT: prologue_length: 0x00000028
 # PART1:      include_directories[  1] = "Directory1"
@@ -90,6 +91,7 @@ LH_2_end:
 
 # PART2:      Line table prologue:
 # PART2-NEXT: total_length: 0x00000028
+# PART2-NEXT: format: DWARF32
 # PART2-NEXT: version: 4
 # PART2-NEXT: prologue_length: 0x00000022
 # PART2-NOT:  prologue:
index 7793d1a..1a35047 100644 (file)
@@ -8,6 +8,7 @@
 # CHECK-NEXT: debug_line[0x00000000]
 # CHECK-NEXT: Line table prologue:
 # CHECK-NEXT:     total_length: 0x00000069
+# CHECK-NEXT:           format: DWARF32
 # CHECK-NEXT:          version: 5
 # CHECK-NEXT:     address_size: 8
 # CHECK-NEXT:  seg_select_size: 0
@@ -47,6 +48,7 @@
 # CHECK-NEXT: debug_line[0x0000006d]
 # CHECK-NEXT: Line table prologue:
 # CHECK-NEXT:     total_length: 0x0000001b
+# CHECK-NEXT:           format: DWARF32
 # CHECK-NEXT:          version: 4
 # CHECK-NEXT:  prologue_length: 0x00000015
 # CHECK-NEXT:  min_inst_length: 2
index 7194010..c7746e5 100644 (file)
@@ -9,6 +9,7 @@
 # CHECK-NEXT: warning: line table program with offset 0x00000000 has length 0xfffffffc but only 0x0000003a bytes are available
 # CHECK-NEXT: Line table prologue:
 # CHECK-NEXT:     total_length: 0x00000000fffffff0
+# CHECK-NEXT:           format: DWARF64
 # CHECK-NEXT:          version: 4
 # CHECK-NEXT:  prologue_length: 0x0000000000000016
 
index 5c9f6ed..23ebdf1 100644 (file)
@@ -59,6 +59,7 @@
 # NONFATAL:      debug_line[0x00000048]
 # NONFATAL-NEXT: Line table prologue
 # NONFATAL-NEXT:    total_length: 0x00000002
+# NONFATAL-NEXT:          format: DWARF32
 # NONFATAL-NEXT:         version: 0
 # NONFATAL-NOT: prologue_length
 
@@ -66,6 +67,7 @@
 # NONFATAL:      debug_line[0x0000004e]
 # NONFATAL-NEXT: Line table prologue
 # NONFATAL-NEXT:    total_length: 0x00000002
+# NONFATAL-NEXT:          format: DWARF32
 # NONFATAL-NEXT:         version: 1
 # NONFATAL-NOT: prologue_length