summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-01-24 07:10:48 +0000
committerGreg Clayton <gclayton@apple.com>2011-01-24 07:10:48 +0000
commit692538db269ddf46c12b8727a579a224b0a4bf57 (patch)
tree4f6d7655c63d36ade420a60c6d65895ff7d988fe
parentb3413c8a82fa5586557a62bf073317154875f077 (diff)
downloadbcm5719-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
-rw-r--r--lldb/lldb.xcodeproj/project.pbxproj1
-rw-r--r--lldb/source/Target/Process.cpp3
-rw-r--r--lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj1
-rw-r--r--lldb/tools/debugserver/source/MacOSX/MachThreadList.cpp26
4 files changed, 23 insertions, 8 deletions
diff --git a/lldb/lldb.xcodeproj/project.pbxproj b/lldb/lldb.xcodeproj/project.pbxproj
index 15016988cdc..6f8eba43164 100644
--- a/lldb/lldb.xcodeproj/project.pbxproj
+++ b/lldb/lldb.xcodeproj/project.pbxproj
@@ -2384,6 +2384,7 @@
isa = PBXProject;
buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
en,
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 9e66b71c40e..3999f150bba 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -2643,9 +2643,6 @@ Process::RunThreadPlan (ExecutionContext &exe_ctx,
Listener listener("lldb.process.listener.run-thread-plan");
exe_ctx.process->HijackProcessEvents(&listener);
- Event *random_event = listener.PeekAtNextEvent();
- // if (random_event != NULL)
- // abort();
lldb::LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP | LIBLLDB_LOG_PROCESS));
if (log)
diff --git a/lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj b/lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj
index d967f16b025..48ec502a0cf 100644
--- a/lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj
+++ b/lldb/tools/debugserver/debugserver.xcodeproj/project.pbxproj
@@ -372,6 +372,7 @@
isa = PBXProject;
buildConfigurationList = 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "debugserver" */;
compatibilityVersion = "Xcode 3.1";
+ developmentRegion = English;
hasScannedForEncodings = 1;
knownRegions = (
English,
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(),
OpenPOWER on IntegriCloud