summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/StopInfo.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-05-29 10:13:03 +0000
committerPavel Labath <labath@google.com>2015-05-29 10:13:03 +0000
commitc4e25c96483643748e6fcf669a776603697365ef (patch)
tree8234c8e68e0e3ee4f7ea7aedf0629623f3171c93 /lldb/source/Target/StopInfo.cpp
parent43a298cb36f8e05e9335bd3deb3214ef5bb99df8 (diff)
downloadbcm5719-llvm-c4e25c96483643748e6fcf669a776603697365ef.tar.gz
bcm5719-llvm-c4e25c96483643748e6fcf669a776603697365ef.zip
Report inferior SIGSEGV as a signal instead of an exception on linux
Summary: Previously, we reported inferior receiving SIGSEGV (or SIGILL, SIGFPE, SIGBUS) as an "exception" to LLDB, presumably to match OSX behaviour. Beside the fact that we were basically lying to the user, this was also causing problems with inferiors which handle SIGSEGV by themselves, since LLDB was unable to reinject this signal back into the inferior. This commit changes LLGS to report SIGSEGV as a signal. This has necessitated some changes in the test-suite, which had previously used eStopReasonException to locate threads that crashed. Now it uses platform-specific logic, which in the case of linux searches for eStopReasonSignaled with signal=SIGSEGV. I have also added the ability to set the description of StopInfoUnixSignal using the description field of the gdb-remote packet. The linux stub uses this to display additional information about the segfault (invalid address, address access protected, etc.). Test Plan: All tests pass on linux and osx. Reviewers: ovyalov, clayborg, emaste Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D10057 llvm-svn: 238549
Diffstat (limited to 'lldb/source/Target/StopInfo.cpp')
-rw-r--r--lldb/source/Target/StopInfo.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Target/StopInfo.cpp b/lldb/source/Target/StopInfo.cpp
index d4957341e04..6cc16132988 100644
--- a/lldb/source/Target/StopInfo.cpp
+++ b/lldb/source/Target/StopInfo.cpp
@@ -871,9 +871,10 @@ class StopInfoUnixSignal : public StopInfo
{
public:
- StopInfoUnixSignal (Thread &thread, int signo) :
+ StopInfoUnixSignal (Thread &thread, int signo, const char *description) :
StopInfo (thread, signo)
{
+ SetDescription (description);
}
virtual ~StopInfoUnixSignal ()
@@ -1161,9 +1162,9 @@ StopInfo::CreateStopReasonWithWatchpointID (Thread &thread, break_id_t watch_id)
}
StopInfoSP
-StopInfo::CreateStopReasonWithSignal (Thread &thread, int signo)
+StopInfo::CreateStopReasonWithSignal (Thread &thread, int signo, const char *description)
{
- return StopInfoSP (new StopInfoUnixSignal (thread, signo));
+ return StopInfoSP (new StopInfoUnixSignal (thread, signo, description));
}
StopInfoSP
OpenPOWER on IntegriCloud