summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-08-28 15:46:54 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-08-28 15:46:54 +0000
commita9882cee50d3ba5716ca39ba831b43ea82c34183 (patch)
tree8b8d40a7af353787acc35496d9f795feaae11ef0 /lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
parenta8833f0c28c86c86d1d059484fe0f44d371eaa47 (diff)
downloadbcm5719-llvm-a9882cee50d3ba5716ca39ba831b43ea82c34183.tar.gz
bcm5719-llvm-a9882cee50d3ba5716ca39ba831b43ea82c34183.zip
llgs: add proper exec support for Linux.
This change: * properly captures execs in NativeProcessLinux. * clears out all non-main-thread thread metadata in NativeProcessLinux on exec. * adds a DidExec() method to the NativeProcessProtocol delegate. * clears out the auxv data cache when we exec (on Linux). This is a small part of the llgs for local Linux debugging work going on here: https://github.com/tfiala/lldb/tree/dev-llgs-local I'm breaking it into small patches. llvm-svn: 216670
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
index ef5b63a3f94..eeef780d172 100644
--- a/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -34,13 +34,16 @@ namespace
switch (stop_info.reason)
{
case eStopReasonSignal:
- log.Printf ("%s: %s: signal 0x%" PRIx32, __FUNCTION__, header, stop_info.details.signal.signo);
+ log.Printf ("%s: %s signal 0x%" PRIx32, __FUNCTION__, header, stop_info.details.signal.signo);
return;
case eStopReasonException:
- log.Printf ("%s: %s: exception type 0x%" PRIx64, __FUNCTION__, header, stop_info.details.exception.type);
+ log.Printf ("%s: %s exception type 0x%" PRIx64, __FUNCTION__, header, stop_info.details.exception.type);
+ return;
+ case eStopReasonExec:
+ log.Printf ("%s: %s exec, stopping signal 0x%" PRIx32, __FUNCTION__, header, stop_info.details.signal.signo);
return;
default:
- log.Printf ("%s: %s: invalid stop reason %" PRIu32, __FUNCTION__, header, static_cast<uint32_t> (stop_info.reason));
+ log.Printf ("%s: %s invalid stop reason %" PRIu32, __FUNCTION__, header, static_cast<uint32_t> (stop_info.reason));
}
}
}
@@ -83,10 +86,10 @@ NativeThreadLinux::GetStopReason (ThreadStopInfo &stop_info)
case eStateSuspended:
case eStateUnloaded:
if (log)
- LogThreadStopInfo (*log, m_stop_info, "m_stop_info in thread: ");
+ LogThreadStopInfo (*log, m_stop_info, "m_stop_info in thread:");
stop_info = m_stop_info;
if (log)
- LogThreadStopInfo (*log, stop_info, "returned stop_info: ");
+ LogThreadStopInfo (*log, stop_info, "returned stop_info:");
return true;
case eStateInvalid:
@@ -246,6 +249,21 @@ NativeThreadLinux::SetStoppedBySignal (uint32_t signo)
}
void
+NativeThreadLinux::SetStoppedByExec ()
+{
+ Log *log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_THREAD));
+ if (log)
+ log->Printf ("NativeThreadLinux::%s()", __FUNCTION__);
+
+ const StateType new_state = StateType::eStateStopped;
+ MaybeLogStateChange (new_state);
+ m_state = new_state;
+
+ m_stop_info.reason = StopReason::eStopReasonExec;
+ m_stop_info.details.signal.signo = SIGSTOP;
+}
+
+void
NativeThreadLinux::SetStoppedByBreakpoint ()
{
const StateType new_state = StateType::eStateStopped;
OpenPOWER on IntegriCloud