[PATCH] D71540: [DebugInfo] Only print a single blank line after an empty line table

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 17 04:07:03 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG5666b70fd074: [DebugInfo] Only print a single blank line after an empty line table (authored by jhenderson).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71540/new/

https://reviews.llvm.org/D71540

Files:
  llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
  llvm/test/tools/llvm-dwarfdump/X86/debug-line.s


Index: llvm/test/tools/llvm-dwarfdump/X86/debug-line.s
===================================================================
--- llvm/test/tools/llvm-dwarfdump/X86/debug-line.s
+++ llvm/test/tools/llvm-dwarfdump/X86/debug-line.s
@@ -62,7 +62,8 @@
 # CHECK-NEXT:       dir_index: 1
 # CHECK-NEXT:        mod_time: 0x00000011
 # CHECK-NEXT:          length: 0x00000022
-# CHECK-NOT:  {{.}}
+# CHECK-EMPTY:
+# CHECK-NEXT: debug_line[0x0000008c]
 
 .section .debug_line,"", at progbits
     .long .Lunit0_end - .Lunit0_begin ## unit_length
@@ -120,7 +121,7 @@
     .byte 0, 0x1, 0x1 ## DW_LNE_end_sequence
 .Lunit0_end:
 
-## Second line table program with version 4.
+## Second line table program with version 4 and no sequences.
     .long .Lunit1_end - .Lunit1_begin ## unit_length
 .Lunit1_begin:
     .short 4 ## version
@@ -143,3 +144,29 @@
     .byte 0x22 ## Length
 .Lheader1_end:
 .Lunit1_end:
+
+## Third line table program needed to show that only a single blank line is
+## printed after a program with no sequences. The values in this table are
+## arbitrary.
+    .long .Lunit2_end - .Lunit2_begin ## unit_length
+.Lunit2_begin:
+    .short 4 ## version
+    .long .Lheader2_end - .Lheader2_begin ## header_length
+.Lheader2_begin:
+    .byte 1 ## minimum_instruction_length
+    .byte 2 ## maximum_operations_per_instruction
+    .byte 1 ## default_is_stmt
+    .byte 1 ## line_base
+    .byte 1 ## line_range
+    .byte 2 ## opcode_base
+    .byte 1 ## standard_opcode_lengths
+    ## include_directories
+    .byte 0
+    ## file_names
+    .asciz "bar.c"
+    .byte 0 ## Directory index
+    .byte 0 ## Timestamp
+    .byte 0 ## Length
+.Lheader2_end:
+    .byte 0, 0x1, 0x1 ## DW_LNE_end_sequence
+.Lunit2_end:
Index: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -453,9 +453,9 @@
 void DWARFDebugLine::LineTable::dump(raw_ostream &OS,
                                      DIDumpOptions DumpOptions) const {
   Prologue.dump(OS, DumpOptions);
-  OS << '\n';
 
   if (!Rows.empty()) {
+    OS << '\n';
     Row::dumpTableHeader(OS);
     for (const Row &R : Rows) {
       R.dump(OS);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71540.234267.patch
Type: text/x-patch
Size: 2260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191217/785c5285/attachment.bin>


More information about the llvm-commits mailing list