[Lldb-commits] [lldb] r283548 - 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 06:22:00 PDT 2016


Author: valentinagiusti
Date: Fri Oct  7 08:21:59 2016
New Revision: 283548

URL: http://llvm.org/viewvc/llvm-project?rev=283548&view=rev
Log:
Fix build failure on lldb-amd64-ninja-freebsd11 error caused by rL283474

Differential Revision: https://reviews.llvm.org/D25362

Modified:
    lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
    lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h

Modified: lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp?rev=283548&r1=283547&r2=283548&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/CrashReason.cpp Fri Oct  7 08:21:59 2016
@@ -136,6 +136,24 @@ CrashReason GetCrashReasonForSIGBUS(cons
 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");
@@ -143,20 +161,14 @@ std::string GetCrashReasonString(CrashRe
 
   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";

Modified: lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h?rev=283548&r1=283547&r2=283548&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h (original)
+++ lldb/trunk/source/Plugins/Process/POSIX/CrashReason.h Fri Oct  7 08:21:59 2016
@@ -50,6 +50,7 @@ enum class CrashReason {
   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);




More information about the lldb-commits mailing list