[PATCH] D74194: [DebugInfo] Allow reading an address table with a mismatched address.
Igor Kudrin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 6 22:34:41 PST 2020
ikudrin created this revision.
ikudrin added reviewers: probinson, dblaikie, aprantl, jhenderson.
ikudrin added projects: LLVM, debug-info.
Herald added a subscriber: hiraditya.
This case does not look as an unrecoverable error.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D74194
Files:
llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp
llvm/test/tools/llvm-dwarfdump/X86/debug_addr_address_size_mismatch.s
Index: llvm/test/tools/llvm-dwarfdump/X86/debug_addr_address_size_mismatch.s
===================================================================
--- llvm/test/tools/llvm-dwarfdump/X86/debug_addr_address_size_mismatch.s
+++ llvm/test/tools/llvm-dwarfdump/X86/debug_addr_address_size_mismatch.s
@@ -1,11 +1,15 @@
# RUN: llvm-mc %s -filetype obj -triple i386-pc-linux -o - | \
-# RUN: llvm-dwarfdump -debug-addr - 2> %t.err | FileCheck %s
-# RUN: FileCheck %s -input-file %t.err -check-prefix=ERR
+# RUN: llvm-dwarfdump -debug-addr - 2> %t.warn | FileCheck %s
+# RUN: FileCheck %s -input-file %t.warn -check-prefix=WARN
-# ERR: .debug_addr table at offset 0x0 has address size 8 which is different from CU address size 4
-# ERR-NOT: {{.}}
+# WARN: .debug_addr table at offset 0x0 has address size 8 which is different from CU address size 4
+# WARN-NOT: {{.}}
# CHECK: .debug_addr contents
+# CHECK-NEXT: length = 0x0000000c, version = 0x0005, addr_size = 0x08, seg_size = 0x00
+# CHECK-NEXT: Addrs: [
+# CHECK-NEXT: 0x0000000100000000
+# CHECK-NEXT: ]
# CHECK-NEXT: length = 0x0000000c, version = 0x0005, addr_size = 0x04, seg_size = 0x00
# CHECK-NEXT: Addrs: [
# CHECK-NEXT: 0x00000000
Index: llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp
===================================================================
--- llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDebugAddr.cpp
@@ -108,11 +108,11 @@
" has unsupported address size %" PRIu8,
HeaderOffset, HeaderData.AddrSize);
if (HeaderData.AddrSize != AddrSize && AddrSize != 0)
- return createStringError(errc::invalid_argument,
- ".debug_addr table at offset 0x%" PRIx64
- " has address size %" PRIu8
- " which is different from CU address size %" PRIu8,
- HeaderOffset, HeaderData.AddrSize, AddrSize);
+ WarnCallback(createStringError(
+ errc::invalid_argument,
+ ".debug_addr table at offset 0x%" PRIx64 " has address size %" PRIu8
+ " which is different from CU address size %" PRIu8,
+ HeaderOffset, HeaderData.AddrSize, AddrSize));
// TODO: add support for non-zero segment selector size.
if (HeaderData.SegSize != 0)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74194.243079.patch
Type: text/x-patch
Size: 2317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200207/2bb56004/attachment.bin>
More information about the llvm-commits
mailing list