[Lldb-commits] [PATCH] D25362: Fix build failure on lldb-amd64-ninja-freebsd11 error caused by rL283474
Valentina Giusti via lldb-commits
lldb-commits at lists.llvm.org
Fri Oct 7 10:45:49 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL283548: Fix build failure on lldb-amd64-ninja-freebsd11 error caused by rL283474 (authored by valentinagiusti).
Changed prior to commit:
https://reviews.llvm.org/D25362?vs=73909&id=73945#toc
Repository:
rL LLVM
https://reviews.llvm.org/D25362
Files:
lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h
Index: lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
===================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
+++ lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
@@ -136,27 +136,39 @@
std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info) {
std::string str;
+// make sure that siginfo_t has the bound fields available.
+#if defined(si_lower) && defined(si_upper)
+ if (reason == CrashReason::eBoundViolation) {
+ str = "signal SIGSEGV";
+ AppendBounds(str, reinterpret_cast<lldb::addr_t>(info.si_lower),
+ reinterpret_cast<lldb::addr_t>(info.si_upper),
+ reinterpret_cast<lldb::addr_t>(info.si_addr));
+ return str;
+ }
+#endif
+
+ return GetCrashReasonString(reason,
+ reinterpret_cast<lldb::addr_t>(info.si_addr));
+}
+
+std::string GetCrashReasonString(CrashReason reason, lldb::addr_t fault_addr) {
+ std::string str;
+
switch (reason) {
default:
assert(false && "invalid CrashReason");
break;
case CrashReason::eInvalidAddress:
str = "signal SIGSEGV: invalid address";
- AppendFaultAddr(str, reinterpret_cast<lldb::addr_t>(info.si_addr));
+ AppendFaultAddr(str, fault_addr);
break;
case CrashReason::ePrivilegedAddress:
str = "signal SIGSEGV: address access protected";
- AppendFaultAddr(str, reinterpret_cast<lldb::addr_t>(info.si_addr));
+ AppendFaultAddr(str, fault_addr);
break;
case CrashReason::eBoundViolation:
- str = "signal SIGSEGV";
-// Make sure that siginfo_t has the bound fields available.
-#if defined(si_lower) && defined(si_upper)
- AppendBounds(str, reinterpret_cast<lldb::addr_t>(info.si_lower),
- reinterpret_cast<lldb::addr_t>(info.si_upper),
- reinterpret_cast<lldb::addr_t>(info.si_addr));
-#endif
+ str = "signal SIGSEGV: bound violation";
break;
case CrashReason::eIllegalOpcode:
str = "signal SIGILL: illegal instruction";
Index: lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h
===================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h
+++ lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h
@@ -50,6 +50,7 @@
eFloatSubscriptRange
};
+std::string GetCrashReasonString(CrashReason reason, lldb::addr_t fault_addr);
std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info);
const char *CrashReasonAsString(CrashReason reason);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25362.73945.patch
Type: text/x-patch
Size: 2573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20161007/64c93049/attachment.bin>
More information about the lldb-commits
mailing list