diff options
author | Greg Clayton <gclayton@apple.com> | 2011-01-24 07:10:48 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-01-24 07:10:48 +0000 |
commit | 692538db269ddf46c12b8727a579a224b0a4bf57 (patch) | |
tree | 4f6d7655c63d36ade420a60c6d65895ff7d988fe /lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp | |
parent | b3413c8a82fa5586557a62bf073317154875f077 (diff) | |
download | bcm5719-llvm-692538db269ddf46c12b8727a579a224b0a4bf57.tar.gz bcm5719-llvm-692538db269ddf46c12b8727a579a224b0a4bf57.zip |
One more thing... Resume any threads that we discover were created while we stop as
they may be in sensitive areas and we set breakpoints on the thread creation routines
if we are running expressions, so the threads should quickly get to a safe spot.
llvm-svn: 124115
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp')
-rw-r--r-- | lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp index 961e7e53b7b..27c0016c4fe 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp @@ -322,20 +322,36 @@ MachThreadList::ProcessWillResume(MachProcess *process, const DNBThreadResumeAct UpdateThreadList(process, true, &new_threads); + DNBThreadResumeAction resume_new_threads = { -1, eStateRunning, 0, INVALID_NUB_ADDRESS }; + + const uint32_t num_new_threads = new_threads.size(); const uint32_t num_threads = m_threads.size(); for (uint32_t idx = 0; idx < num_threads; ++idx) { MachThread *thread = m_threads[idx].get(); + bool handled = false; + for (uint32_t new_idx = 0; new_idx < num_new_threads; ++new_idx) + { + if (thread == new_threads[new_idx].get()) + { + thread->ThreadWillResume(&resume_new_threads); + handled = true; + break; + } + } - const DNBThreadResumeAction *thread_action = thread_actions.GetActionForThread (thread->ThreadID(), true); - // There must always be a thread action for every thread. - assert (thread_action); - thread->ThreadWillResume (thread_action); + if (!handled) + { + const DNBThreadResumeAction *thread_action = thread_actions.GetActionForThread (thread->ThreadID(), true); + // There must always be a thread action for every thread. + assert (thread_action); + thread->ThreadWillResume (thread_action); + } } if (new_threads.size()) { - for (uint32_t idx = 0, num_new_threads = new_threads.size(); idx < num_new_threads; ++idx) + for (uint32_t idx = 0; idx < num_new_threads; ++idx) { DNBLogThreadedIf (LOG_THREAD, "MachThreadList::ProcessWillResume (pid = %4.4x) stop-id=%u, resuming newly discovered thread: 0x%4.4x, thread-is-user-ready=%i)", process->ProcessID(), |