aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-09-11 23:29:14 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-09-11 23:29:14 +0000
commit511e5cdce4020e221d3a8609492004e908ccfc1a (patch)
tree3eb6c795c832cc84797dac0c63a87955458e97d4 /lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
parent3d7260e7b21b6630ac42e1838c582a84c57e8a95 (diff)
downloadllvm-511e5cdce4020e221d3a8609492004e908ccfc1a.zip
llvm-511e5cdce4020e221d3a8609492004e908ccfc1a.tar.gz
llvm-511e5cdce4020e221d3a8609492004e908ccfc1a.tar.bz2
llgs: fix Ctrl-C inferior interrupt handling to do the right thing.
* Sends a SIGSTOP to the process. * Fixes busted SIGSTOP handling. Now builds a list of non-stopped that we wait for the PTRACE group-stop for. When the final must-stop tid gets its group stop, we propagate the process state change. Only the signal receiving the notification of the pending SIGSTOP is marked with the SIGSTOP signal. All the rest, if they weren't already stopped, are marked as stopped with signal 0. * Fixes a few broken tests. * Marks the Linux test I added earlier as expect-pass (no longer XFAIL). Implements fix for http://llvm.org/bugs/show_bug.cgi?id=20908. llvm-svn: 217647
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
index 8e010a5..4158e3d 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -259,6 +259,25 @@ NativeThreadLinux::SetStoppedBySignal (uint32_t signo)
m_stop_info.details.signal.signo = signo;
}
+bool
+NativeThreadLinux::IsStopped (int *signo)
+{
+ if (!StateIsStoppedState (m_state, false))
+ return false;
+
+ // If we are stopped by a signal, return the signo.
+ if (signo &&
+ m_state == StateType::eStateStopped &&
+ m_stop_info.reason == StopReason::eStopReasonSignal)
+ {
+ *signo = m_stop_info.details.signal.signo;
+ }
+
+ // Regardless, we are stopped.
+ return true;
+}
+
+
void
NativeThreadLinux::SetStoppedByExec ()
{