[PATCH] D14772: [llvm-symbolizer] Add architecture fallback from x86_64h to x86_64
Kuba Brecka via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 06:13:06 PST 2015
kubabrecka created this revision.
kubabrecka added reviewers: samsonov, rafael, friss.
kubabrecka added subscribers: llvm-commits, zaks.anna, ismailp.
On OS X, x86_64h architecture can be mixed with x86_64 in a single process. When we try to symbolicate addresss from a sanitizer, llvm-symbolizer is called with `--default-arch=x86_64h` (when running on a Haswell+ machine). However, if a binary/library contains only the x86_64 slice, llvm-symbolizer simply fails. We should fallback from x86_64h to x86_64 if the x86_64h slice is not present.
http://reviews.llvm.org/D14772
Files:
lib/DebugInfo/Symbolize/Symbolize.cpp
Index: lib/DebugInfo/Symbolize/Symbolize.cpp
===================================================================
--- lib/DebugInfo/Symbolize/Symbolize.cpp
+++ lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -355,8 +355,17 @@
auto ObjectsOrErr = getOrCreateObjects(BinaryName, ArchName);
if (auto EC = ObjectsOrErr.getError()) {
// Failed to find valid object file.
- Modules.insert(std::make_pair(ModuleName, EC));
- return EC;
+ // For x86_64h, fallback to x86_64.
+ if (ArchName == "x86_64h") {
+ ObjectsOrErr = getOrCreateObjects(BinaryName, "x86_64");
+ if (auto EC = ObjectsOrErr.getError()) {
+ Modules.insert(std::make_pair(ModuleName, EC));
+ return EC;
+ }
+ } else {
+ Modules.insert(std::make_pair(ModuleName, EC));
+ return EC;
+ }
}
ObjectPair Objects = ObjectsOrErr.get();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14772.40498.patch
Type: text/x-patch
Size: 856 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151118/aba9aef6/attachment.bin>
More information about the llvm-commits
mailing list