[PATCH] D73438: [Symbolize] Handle error after the notes loop
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 26 16:15:22 PST 2020
phosek created this revision.
phosek added reviewers: dblaikie, vsk, lhames, delcypher.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
We always have to check the error, even if we're going to ignore it.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D73438
Files:
llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
llvm/test/DebugInfo/symbolize-build-id-error.test
Index: llvm/test/DebugInfo/symbolize-build-id-error.test
===================================================================
--- /dev/null
+++ llvm/test/DebugInfo/symbolize-build-id-error.test
@@ -0,0 +1,23 @@
+# RUN: yaml2obj %s -o %t
+
+# RUN: llvm-symbolizer --debug-file-directory=%p/Inputs --obj=%t 0x20112f | FileCheck %s
+
+# CHECK: ??
+# CHECK-NEXT: ??:0:0
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_X86_64
+Sections:
+ - Name: .note.invalid
+ Type: SHT_NOTE
+ Flags: [ SHF_ALLOC ]
+ Content: 0123456789
+ProgramHeaders:
+ - Type: PT_NOTE
+ Flags: [ PF_R ]
+ Sections:
+ - Section: .note.invalid
Index: llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
===================================================================
--- llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -300,6 +300,7 @@
for (auto N : Obj->notes(P, Err))
if (N.getType() == ELF::NT_GNU_BUILD_ID && N.getName() == ELF::ELF_NOTE_GNU)
return N.getDesc();
+ consumeError(std::move(Err));
}
return {};
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73438.240455.patch
Type: text/x-patch
Size: 1144 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200127/66f84be4/attachment.bin>
More information about the llvm-commits
mailing list