Index: source/Plugins/Process/POSIX/CrashReason.h =================================================================== --- source/Plugins/Process/POSIX/CrashReason.h +++ 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); Index: source/Plugins/Process/POSIX/CrashReason.cpp =================================================================== --- source/Plugins/Process/POSIX/CrashReason.cpp +++ source/Plugins/Process/POSIX/CrashReason.cpp @@ -136,6 +136,27 @@ std::string GetCrashReasonString(CrashReason reason, const siginfo_t &info) { std::string str; + if (reason == CrashReason::eBoundViolation) { +// make sure that siginfo_t has the bound fields available. +#if defined(si_lower) && defined(si_upper) + str = "signal SIGSEGV"; + AppendBounds(str, reinterpret_cast(info.si_lower), + reinterpret_cast(info.si_upper), + reinterpret_cast(info.si_addr)); +#else + str = GetCrashReasonString(reason, + reinterpret_cast(info.si_addr)); +#endif + } else { + str = GetCrashReasonString(reason, + reinterpret_cast(info.si_addr)); + } + return str; +} + +std::string GetCrashReasonString(CrashReason reason, lldb::addr_t fault_addr) { + std::string str; + switch (reason) { default: assert(false && "invalid CrashReason"); @@ -143,20 +164,14 @@ case CrashReason::eInvalidAddress: str = "signal SIGSEGV: invalid address"; - AppendFaultAddr(str, reinterpret_cast(info.si_addr)); + AppendFaultAddr(str, fault_addr); break; case CrashReason::ePrivilegedAddress: str = "signal SIGSEGV: address access protected"; - AppendFaultAddr(str, reinterpret_cast(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(info.si_lower), - reinterpret_cast(info.si_upper), - reinterpret_cast(info.si_addr)); -#endif + str = "signal SIGSEGV: bound violation"; break; case CrashReason::eIllegalOpcode: str = "signal SIGILL: illegal instruction";