diff options
author | Jim Ingham <jingham@apple.com> | 2011-01-22 01:33:44 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2011-01-22 01:33:44 +0000 |
commit | 1c823b43e58310fc508a712c93d7b46344413367 (patch) | |
tree | 47338785cb2ee77e0276cd82c1e35d27caf23d95 /lldb/source/Target/ThreadList.cpp | |
parent | e22e88b8a88461adfa2ee84f4c57b6a0ad9bc943 (diff) | |
download | bcm5719-llvm-1c823b43e58310fc508a712c93d7b46344413367.tar.gz bcm5719-llvm-1c823b43e58310fc508a712c93d7b46344413367.zip |
Added an interface for noticing new thread creation. At this point, I only turn it on when
we are requesting a single thread to run. May seem like a silly thing to do, but the kernel
on MacOS X will inject new threads into a program willy-nilly, and I would like to keep them
from running if I can.
llvm-svn: 124018
Diffstat (limited to 'lldb/source/Target/ThreadList.cpp')
-rw-r--r-- | lldb/source/Target/ThreadList.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lldb/source/Target/ThreadList.cpp b/lldb/source/Target/ThreadList.cpp index e5056326b1c..fa1758b54da 100644 --- a/lldb/source/Target/ThreadList.cpp +++ b/lldb/source/Target/ThreadList.cpp @@ -352,6 +352,10 @@ ThreadList::RefreshStateAfterStop () Mutex::Locker locker(m_threads_mutex); m_process->UpdateThreadListIfNeeded(); + + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + if (log) + log->Printf ("Turning off notification of new threads while single stepping a thread."); collection::iterator pos, end = m_threads.end(); for (pos = m_threads.begin(); pos != end; ++pos) @@ -403,6 +407,20 @@ ThreadList::WillResume () } } + if (wants_solo_run) + { + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + if (log) + log->Printf ("Turning on notification of new threads while single stepping a thread."); + m_process->StartNoticingNewThreads(); + } + else + { + LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); + if (log) + log->Printf ("Turning off notification of new threads while single stepping a thread."); + m_process->StopNoticingNewThreads(); + } // Give all the threads that are likely to run a last chance to set up their state before we // negotiate who is actually going to get a chance to run... |