summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-01-24 06:11:50 +0000
committerGreg Clayton <gclayton@apple.com>2011-01-24 06:11:50 +0000
commit26783fea37bda2abd200eae72828279ba3b6e6e6 (patch)
tree5f7af0015045e227571522ce2cee19e97b708046
parentabcbc8aca8febfd0c9a8310a52c45a8a9e815e75 (diff)
downloadbcm5719-llvm-26783fea37bda2abd200eae72828279ba3b6e6e6.tar.gz
bcm5719-llvm-26783fea37bda2abd200eae72828279ba3b6e6e6.zip
Added logging for threads that are spawned while we stop. We log their
existence if the "thread" log bit is enabled right before we resume. llvm-svn: 124110
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp25
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachThreadList.h2
2 files changed, 25 insertions, 2 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
index 84031bdd555..38c25d2f03b 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp
@@ -194,7 +194,7 @@ MachThreadList::Clear()
}
uint32_t
-MachThreadList::UpdateThreadList(MachProcess *process, bool update)
+MachThreadList::UpdateThreadList(MachProcess *process, bool update, MachThreadList::collection *new_threads)
{
// locker will keep a mutex locked until it goes out of scope
DNBLogThreadedIf (LOG_THREAD, "MachThreadList::UpdateThreadList (pid = %4.4x, update = %u) process stop count = %u", process->ProcessID(), update, process->StopCount());
@@ -250,6 +250,11 @@ MachThreadList::UpdateThreadList(MachProcess *process, bool update)
{
// We don't have this thread, lets add it.
thread_sp.reset(new MachThread(process, tid));
+
+ // Add the new thread regardless of its is user ready state...
+ if (new_threads)
+ new_threads->push_back(thread_sp);
+
// Make sure the thread is ready to be displayed and shown to users
// before we add this thread to our list...
if (thread_sp->IsUserReady())
@@ -320,6 +325,24 @@ MachThreadList::ProcessWillResume(MachProcess *process, const DNBThreadResumeAct
assert (thread_action);
thread->ThreadWillResume (thread_action);
}
+
+ if (DNBLogCheckLogBit(LOG_THREAD))
+ {
+ MachThreadList::collection new_threads;
+ UpdateThreadList(process, true, &new_threads);
+ if (new_threads.size())
+ {
+
+ for (uint32_t idx = 0, num_new_threads = new_threads.size(); idx < num_new_threads; ++idx)
+ {
+ DNBLogThreadedIf (LOG_THREAD, "MachThreadList::ProcessWillResume (pid = %4.4x) stop-id=%u, newly discovered thread: 0x%4.4x, thread-is-user-ready=%i)",
+ process->ProcessID(),
+ process->StopCount(),
+ new_threads[idx]->ThreadID(),
+ new_threads[idx]->IsUserReady());
+ }
+ }
+ }
}
uint32_t
diff --git a/lldb/tools/debugserver/source/MacOSX/MachThreadList.h b/lldb/tools/debugserver/source/MacOSX/MachThreadList.h
index 4ffa7e6610e..b010a213619 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachThreadList.h
+++ b/lldb/tools/debugserver/source/MacOSX/MachThreadList.h
@@ -59,7 +59,7 @@ protected:
typedef collection::iterator iterator;
typedef collection::const_iterator const_iterator;
- uint32_t UpdateThreadList (MachProcess *process, bool update);
+ uint32_t UpdateThreadList (MachProcess *process, bool update, collection *num_threads = NULL);
// const_iterator FindThreadByID (thread_t tid) const;
collection m_threads;
OpenPOWER on IntegriCloud