[llvm] 7a45aea - Revert "llvm-dwarfdump: Report errors when failing to parse loclist/debug_loc entries"
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 11 16:55:52 PDT 2020
Author: David Blaikie
Date: 2020-04-11T16:54:49-07:00
New Revision: 7a45aeacf3a23449039ef2efcf476995ae1c7007
URL: https://github.com/llvm/llvm-project/commit/7a45aeacf3a23449039ef2efcf476995ae1c7007
DIFF: https://github.com/llvm/llvm-project/commit/7a45aeacf3a23449039ef2efcf476995ae1c7007.diff
LOG: Revert "llvm-dwarfdump: Report errors when failing to parse loclist/debug_loc entries"
Broke an LLDB build bot & I can't seem to build LLDB locally to fix
forward...
http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/15567/steps/test/logs/stdio
This reverts commit 416fa7720e30750939c53935051c6c750dfad2c2.
Added:
Modified:
llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases.s
llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases2.s
llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s
llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases2.s
llvm/test/DebugInfo/X86/dwarfdump-ranges-baseaddr.s
llvm/test/DebugInfo/X86/dwarfdump-str-offsets-invalid-6.s
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_address_size_not_multiple.s
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_invalid_addr_size.s
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_reserved_length.s
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_segment_selector.s
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_small_length_field.s
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_extended_length_field.s
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_length_field.s
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_section.s
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_unsupported_version.s
llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists.s
llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_invalid.s
llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_reserved_length.s
llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
Removed:
################################################################################
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
index 17f0b7f5c32a..8f047bb872e5 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp
@@ -156,7 +156,9 @@ bool DWARFLocationTable::dumpLocationList(uint64_t *Offset, raw_ostream &OS,
return true;
});
if (E) {
- DumpOpts.RecoverableErrorHandler(std::move(E));
+ OS << "\n";
+ OS.indent(Indent);
+ OS << "error: " << toString(std::move(E));
return false;
}
return true;
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases.s b/llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases.s
index b623894d5e2d..5ee701b03fba 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases.s
@@ -1,20 +1,20 @@
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE1=0 -o %t1.o
-# RUN: not llvm-dwarfdump -debug-loc %t1.o 2>&1 | FileCheck %s
+# RUN: llvm-dwarfdump -debug-loc %t1.o 2>&1 | FileCheck %s
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE2=0 -o %t2.o
-# RUN: not llvm-dwarfdump -debug-loc %t2.o 2>&1 | FileCheck %s
+# RUN: llvm-dwarfdump -debug-loc %t2.o 2>&1 | FileCheck %s
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE3=0 -o %t3.o
-# RUN: not llvm-dwarfdump -debug-loc %t3.o 2>&1 | FileCheck %s
+# RUN: llvm-dwarfdump -debug-loc %t3.o 2>&1 | FileCheck %s
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE4=0 -o %t4.o
-# RUN: not llvm-dwarfdump -debug-loc %t4.o 2>&1 | FileCheck %s
+# RUN: llvm-dwarfdump -debug-loc %t4.o 2>&1 | FileCheck %s
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE5=0 -o %t5.o
-# RUN: not llvm-dwarfdump -debug-loc %t5.o 2>&1 | FileCheck %s
+# RUN: llvm-dwarfdump -debug-loc %t5.o 2>&1 | FileCheck %s
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE6=0 -o %t6.o
-# RUN: not llvm-dwarfdump -debug-loc %t6.o 2>&1 | FileCheck %s
+# RUN: llvm-dwarfdump -debug-loc %t6.o 2>&1 | FileCheck %s
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE7=0 -o %t7.o
# RUN: llvm-dwarfdump -debug-loc %t7.o 2>&1 | FileCheck %s --check-prefix=UNKNOWN-REG
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases2.s b/llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases2.s
index 8a1abd6684d1..7e951e58d2c7 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases2.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-debug-loc-error-cases2.s
@@ -1,6 +1,5 @@
# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t
-# RUN: not llvm-dwarfdump %t 2>%t.err | FileCheck %s
-# RUN: FileCheck %s < %t.err -check-prefix=ERR
+# RUN: llvm-dwarfdump %t | FileCheck %s
# CHECK: DW_AT_name ("x0")
# CHECK-NEXT: DW_AT_location (0x00000000
@@ -8,12 +7,12 @@
# CHECK-NEXT: [0x0000000000000002, 0x0000000000000003): DW_OP_reg0 RAX)
# CHECK: DW_AT_name ("x1")
-# CHECK-NEXT: DW_AT_location (0xdeadbeef: )
-# ERR: error: unexpected end of data at offset 0xdeadbeef
+# CHECK-NEXT: DW_AT_location (0xdeadbeef
+# CHECK-NEXT: error: unexpected end of data at offset 0xdeadbeef)
# CHECK: DW_AT_name ("x2")
-# CHECK-NEXT: DW_AT_location (0x00000036: )
-# ERR: error: unexpected end of data at offset 0x48
+# CHECK-NEXT: DW_AT_location (0x00000036
+# CHECK-NEXT: error: unexpected end of data at offset 0x48)
.type f, at function
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s b/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s
index 048104986fa4..bb83684d6028 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases.s
@@ -1,23 +1,23 @@
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE1=0 -o %t1.o
-# RUN: not llvm-dwarfdump -debug-loclists %t1.o 2>&1 | FileCheck %s --check-prefix=ULEB
+# RUN: llvm-dwarfdump -debug-loclists %t1.o 2>&1 | FileCheck %s --check-prefix=ULEB
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE2=0 -o %t2.o
-# RUN: not llvm-dwarfdump -debug-loclists %t2.o 2>&1 | FileCheck %s --check-prefix=ULEB
+# RUN: llvm-dwarfdump -debug-loclists %t2.o 2>&1 | FileCheck %s --check-prefix=ULEB
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE3=0 -o %t3.o
-# RUN: not llvm-dwarfdump -debug-loclists %t3.o 2>&1 | FileCheck %s --check-prefix=ULEB
+# RUN: llvm-dwarfdump -debug-loclists %t3.o 2>&1 | FileCheck %s --check-prefix=ULEB
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE4=0 -o %t4.o
-# RUN: not llvm-dwarfdump -debug-loclists %t4.o 2>&1 | FileCheck %s
+# RUN: llvm-dwarfdump -debug-loclists %t4.o 2>&1 | FileCheck %s
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE5=0 -o %t5.o
-# RUN: not llvm-dwarfdump -debug-loclists %t5.o 2>&1 | FileCheck %s
+# RUN: llvm-dwarfdump -debug-loclists %t5.o 2>&1 | FileCheck %s
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE6=0 -o %t6.o
-# RUN: not llvm-dwarfdump -debug-loclists %t6.o 2>&1 | FileCheck %s
+# RUN: llvm-dwarfdump -debug-loclists %t6.o 2>&1 | FileCheck %s
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux --defsym CASE7=0 -o %t7.o
-# RUN: not llvm-dwarfdump -debug-loclists %t7.o 2>&1 | FileCheck %s --check-prefix=UNIMPL
+# RUN: llvm-dwarfdump -debug-loclists %t7.o 2>&1 | FileCheck %s --check-prefix=UNIMPL
# CHECK: error: unexpected end of data
# ULEB: error: malformed uleb128, extends past end
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases2.s b/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases2.s
index 14dc7f49d681..f15d071cce3d 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases2.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-debug-loclists-error-cases2.s
@@ -1,6 +1,5 @@
# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t
-# RUN: not llvm-dwarfdump %t 2> %t.err | FileCheck %s
-# RUN: FileCheck %s < %t.err -check-prefix=ERR
+# RUN: not llvm-dwarfdump %t | FileCheck %s
# CHECK: DW_AT_name ("x0")
# CHECK-NEXT: DW_AT_location (0x0000000c
@@ -8,12 +7,12 @@
# CHECK-NEXT: [0x0000000000000002, 0x0000000000000003): DW_OP_reg0 RAX)
# CHECK: DW_AT_name ("x1")
-# CHECK-NEXT: DW_AT_location (0xdeadbeef: )
-# ERR: error: unexpected end of data at offset 0xdeadbeef
+# CHECK-NEXT: DW_AT_location (0xdeadbeef
+# CHECK-NEXT: error: unexpected end of data at offset 0xdeadbeef)
# CHECK: DW_AT_name ("x2")
# CHECK-NEXT: DW_AT_location (0x00000025
-# ERR: error: unexpected end of data at offset 0x34
+# CHECK-NEXT: error: unexpected end of data at offset 0x34)
.type f, at function
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-ranges-baseaddr.s b/llvm/test/DebugInfo/X86/dwarfdump-ranges-baseaddr.s
index 22254b92e559..7d5a6f938bd4 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-ranges-baseaddr.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-ranges-baseaddr.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t
-# RUN: not llvm-dwarfdump -v %t 2>%t.err | FileCheck %s
+# RUN: llvm-dwarfdump -v %t 2>%t.err | FileCheck %s
# RUN: FileCheck %s <%t.err -check-prefix=ERR
# CHECK: .debug_info contents:
diff --git a/llvm/test/DebugInfo/X86/dwarfdump-str-offsets-invalid-6.s b/llvm/test/DebugInfo/X86/dwarfdump-str-offsets-invalid-6.s
index 6b8c669e143d..01bc39c68610 100644
--- a/llvm/test/DebugInfo/X86/dwarfdump-str-offsets-invalid-6.s
+++ b/llvm/test/DebugInfo/X86/dwarfdump-str-offsets-invalid-6.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc -triple x86_64-unknown-linux %s -filetype=obj -o %t.o
-# RUN: not llvm-dwarfdump -v %t.o 2>&1 | FileCheck --check-prefix=OVERLAP %s
+# RUN: llvm-dwarfdump -v %t.o 2>&1 | FileCheck --check-prefix=OVERLAP %s
#
# Test object to verify that llvm-dwarfdump handles an invalid string offsets
# table with overlapping contributions.
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_address_size_not_multiple.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_address_size_not_multiple.s
index dd0c46f3ebf0..d758709c6703 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_address_size_not_multiple.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_address_size_not_multiple.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple i386-pc-linux -o - | \
-# RUN: not llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
+# RUN: llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
# RUN: FileCheck %s -input-file %t.err -check-prefix=ERR
# CHECK: .debug_addr contents:
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_invalid_addr_size.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_invalid_addr_size.s
index 2638471f4426..0ad055b2753d 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_invalid_addr_size.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_invalid_addr_size.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple i386-pc-linux -o - | \
-# RUN: not llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
+# RUN: llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
# RUN: FileCheck %s -input-file %t.err -check-prefix=ERR
# CHECK: .debug_addr contents:
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_reserved_length.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_reserved_length.s
index aaedf7f53810..125be8307507 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_reserved_length.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_reserved_length.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o - | \
-# RUN: not llvm-dwarfdump --debug-addr - 2>&1 | \
+# RUN: llvm-dwarfdump --debug-addr - 2>&1 | \
# RUN: FileCheck %s --implicit-check-not=error
# CHECK: error: parsing address table at offset 0x0: unsupported reserved unit length of value 0xfffffff0
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_segment_selector.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_segment_selector.s
index 5207951c4091..3200b4f2da3b 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_segment_selector.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_segment_selector.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple i386-pc-linux -o - | \
-# RUN: not llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
+# RUN: llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
# RUN: FileCheck %s -input-file %t.err -check-prefix=ERR
# CHECK: .debug_addr contents:
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_small_length_field.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_small_length_field.s
index b4875335adf0..3b12737ddf59 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_small_length_field.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_small_length_field.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple i386-pc-linux -o - | \
-# RUN: not llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
+# RUN: llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
# RUN: FileCheck %s -input-file %t.err -check-prefix=ERR
# CHECK: .debug_addr contents:
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_extended_length_field.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_extended_length_field.s
index 1034c97f7647..8ac3cc55324d 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_extended_length_field.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_extended_length_field.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple i386-pc-linux -o - | \
-# RUN: not llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
+# RUN: llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
# RUN: FileCheck %s -input-file %t.err -check-prefix=ERR
# CHECK: .debug_addr contents:
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_length_field.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_length_field.s
index bc840ebf7fab..1a5154117011 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_length_field.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_length_field.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple i386-pc-linux -o - | \
-# RUN: not llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
+# RUN: llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
# RUN: FileCheck %s -input-file %t.err -check-prefix=ERR
# CHECK: .debug_addr contents:
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_section.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_section.s
index 4de8df404367..5bd90617e259 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_section.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_too_small_for_section.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple i386-pc-linux -o - | \
-# RUN: not llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
+# RUN: llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
# RUN: FileCheck %s -input-file %t.err -check-prefix=ERR
# CHECK: .debug_addr contents:
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_unsupported_version.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_unsupported_version.s
index dec91fe073fc..4eeeaa7e6980 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_unsupported_version.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_addr_unsupported_version.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple i386-pc-linux -o - | \
-# RUN: not llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
+# RUN: llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
# RUN: FileCheck %s -input-file %t.err -check-prefix=ERR
# ERR: address table at offset 0x0 has unsupported version 6
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists.s
index 650fc1aafbd6..60533ca27217 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists.s
@@ -1,8 +1,7 @@
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o %t.o
-# RUN: not llvm-dwarfdump --debug-rnglists %t.o 2> %t.err | FileCheck %s --check-prefixes=TERSE,BOTH
-# RUN: FileCheck %s --input-file %t.err --check-prefix=ERR
-# RUN: not llvm-dwarfdump -v --debug-rnglists %t.o 2> %t.err | FileCheck %s --check-prefixes=VERBOSE,BOTH
+# RUN: llvm-dwarfdump --debug-rnglists %t.o 2> %t.err | FileCheck %s --check-prefixes=TERSE,BOTH
# RUN: FileCheck %s --input-file %t.err --check-prefix=ERR
+# RUN: llvm-dwarfdump -v --debug-rnglists %t.o 2> %t.err | FileCheck %s --check-prefixes=VERBOSE,BOTH
# BOTH: .debug_rnglists contents:
# TERSE-NEXT: range list header: length = 0x00000037, version = 0x0005, addr_size = 0x08, seg_size = 0x00, offset_entry_count = 0x00000000
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_invalid.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_invalid.s
index 64060471f055..b11a2cc8bfde 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_invalid.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_invalid.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %S/Inputs/debug_rnglists_short_section.s -filetype obj -triple x86_64-pc-linux -o - | \
-# RUN: not llvm-dwarfdump --debug-rnglists - 2>&1 | FileCheck %s --check-prefix=SHORT
+# RUN: llvm-dwarfdump --debug-rnglists - 2>&1 | FileCheck %s --check-prefix=SHORT
# SHORT-NOT: error:
# SHORT-NOT: range list header
# SHORT: error: parsing .debug_rnglists table at offset 0x0: unexpected end of data at offset 0x0
@@ -7,7 +7,7 @@
# SHORT-NOT: error:
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o - | \
-# RUN: not llvm-dwarfdump --debug-rnglists - 2> %t.err | FileCheck %s --check-prefix=GOOD
+# RUN: llvm-dwarfdump --debug-rnglists - 2> %t.err | FileCheck %s --check-prefix=GOOD
# RUN: FileCheck %s --input-file %t.err
# GOOD: .debug_rnglists contents:
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_reserved_length.s b/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_reserved_length.s
index 27c30d93cb7b..7db4aefde761 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_reserved_length.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/debug_rnglists_reserved_length.s
@@ -1,5 +1,5 @@
# RUN: llvm-mc %s -filetype obj -triple x86_64-pc-linux -o - | \
-# RUN: not llvm-dwarfdump --debug-rnglists - 2>&1 | \
+# RUN: llvm-dwarfdump --debug-rnglists - 2>&1 | \
# RUN: FileCheck %s --implicit-check-not=error
# CHECK: error: parsing .debug_rnglists table at offset 0x0: unsupported reserved unit length of value 0xfffffff0
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index 31de753e7a19..14115c8eb998 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -243,7 +243,7 @@ static void error(StringRef Prefix, std::error_code EC) {
exit(1);
}
-static DIDumpOptions getDumpOpts(DWARFContext& C) {
+static DIDumpOptions getDumpOpts() {
DIDumpOptions DumpOpts;
DumpOpts.DumpType = DumpType;
DumpOpts.ChildRecurseDepth = ChildRecurseDepth;
@@ -254,7 +254,6 @@ static DIDumpOptions getDumpOpts(DWARFContext& C) {
DumpOpts.ShowForm = ShowForm;
DumpOpts.SummarizeTypes = SummarizeTypes;
DumpOpts.Verbose = Verbose;
- DumpOpts.RecoverableErrorHandler = C.getRecoverableErrorHandler();
// In -verify mode, print DIEs without children in error messages.
if (Verify)
return DumpOpts.noImplicitRecursion();
@@ -295,7 +294,6 @@ using HandlerFn = std::function<bool(ObjectFile &, DWARFContext &DICtx,
/// Print only DIEs that have a certain name.
static bool filterByName(const StringSet<> &Names, DWARFDie Die,
StringRef NameRef, raw_ostream &OS) {
- DIDumpOptions DumpOpts = getDumpOpts(Die.getDwarfUnit()->getContext());
std::string Name =
(IgnoreCase && !UseRegex) ? NameRef.lower() : NameRef.str();
if (UseRegex) {
@@ -308,13 +306,13 @@ static bool filterByName(const StringSet<> &Names, DWARFDie Die,
exit(1);
}
if (RE.match(Name)) {
- Die.dump(OS, 0, DumpOpts);
+ Die.dump(OS, 0, getDumpOpts());
return true;
}
}
} else if (Names.count(Name)) {
// Match full text.
- Die.dump(OS, 0, DumpOpts);
+ Die.dump(OS, 0, getDumpOpts());
return true;
}
return false;
@@ -387,9 +385,8 @@ static void filterByAccelName(ArrayRef<std::string> Names, DWARFContext &DICtx,
llvm::sort(Dies);
Dies.erase(std::unique(Dies.begin(), Dies.end()), Dies.end());
- DIDumpOptions DumpOpts = getDumpOpts(DICtx);
for (DWARFDie Die : Dies)
- Die.dump(OS, 0, DumpOpts);
+ Die.dump(OS, 0, getDumpOpts());
}
/// Handle the --lookup option and dump the DIEs and line info for the given
@@ -405,7 +402,7 @@ static bool lookup(ObjectFile &Obj, DWARFContext &DICtx, uint64_t Address,
if (!DIEsForAddr)
return false;
- DIDumpOptions DumpOpts = getDumpOpts(DICtx);
+ DIDumpOptions DumpOpts = getDumpOpts();
DumpOpts.ChildRecurseDepth = 0;
DIEsForAddr.CompileUnit->dump(OS, DumpOpts);
if (DIEsForAddr.FunctionDIE) {
@@ -453,7 +450,7 @@ static bool dumpObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
}
// Dump the complete DWARF structure.
- DICtx.dump(OS, getDumpOpts(DICtx), DumpOffsets);
+ DICtx.dump(OS, getDumpOpts(), DumpOffsets);
return true;
}
@@ -464,7 +461,7 @@ static bool verifyObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
raw_ostream &stream = Quiet ? nulls() : OS;
stream << "Verifying " << Filename.str() << ":\tfile format "
<< Obj.getFileFormatName() << "\n";
- bool Result = DICtx.verify(stream, getDumpOpts(DICtx));
+ bool Result = DICtx.verify(stream, getDumpOpts());
if (Result)
stream << "No errors.\n";
else
More information about the llvm-commits
mailing list