summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2016-12-08 06:27:29 +0000
committerJason Molenda <jmolenda@apple.com>2016-12-08 06:27:29 +0000
commitb3a3cd1f4ebe11abfd2297c535ab0858e6a4818a (patch)
tree6a8f7791d57032d014fb2bdcc881b359645a149a /lldb/source/Target/Process.cpp
parent6a4eb75c46dc11578c4dd47db82c7a69a8f65839 (diff)
downloadbcm5719-llvm-b3a3cd1f4ebe11abfd2297c535ab0858e6a4818a.tar.gz
bcm5719-llvm-b3a3cd1f4ebe11abfd2297c535ab0858e6a4818a.zip
When we interrupt a process, it was possible or the thread names
to not be set by Process::WillPublicStop() so the driver won't get access to them. The fix is straightforward, moving the call to WillPublicStop above the early return for the interrupt case. (the interrupt case does an early return because the rest of the function is concerned with running stop hooks etc and those are not applicable when we've interrupted the process). Also added a test case for it. The test case is a little complicated because I needed to drive lldb asynchronously to give the program a chance to get up and running before I interrupt it. Running to a breakpoint was not sufficient to catch this bug. <rdar://problem/22693778> llvm-svn: 289026
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 76b95f23b15..f8e31004fa1 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -4180,6 +4180,13 @@ void Process::ProcessEventData::DoOnRemoval(Event *event_ptr) {
process_sp->SetPublicState(
m_state, Process::ProcessEventData::GetRestartedFromEvent(event_ptr));
+ if (m_state == eStateStopped && !m_restarted) {
+ // Let process subclasses know we are about to do a public stop and
+ // do anything they might need to in order to speed up register and
+ // memory accesses.
+ process_sp->WillPublicStop();
+ }
+
// If this is a halt event, even if the halt stopped with some reason other
// than a plain interrupt (e.g. we had
// already stopped for a breakpoint when the halt request came through) don't
@@ -4190,11 +4197,6 @@ void Process::ProcessEventData::DoOnRemoval(Event *event_ptr) {
// If we're stopped and haven't restarted, then do the StopInfo actions here:
if (m_state == eStateStopped && !m_restarted) {
- // Let process subclasses know we are about to do a public stop and
- // do anything they might need to in order to speed up register and
- // memory accesses.
- process_sp->WillPublicStop();
-
ThreadList &curr_thread_list = process_sp->GetThreadList();
uint32_t num_threads = curr_thread_list.GetSize();
uint32_t idx;
OpenPOWER on IntegriCloud