[Lldb-commits] [lldb] r124115 - in /lldb/trunk: lldb.xcodeproj/project.pbxproj source/Target/Process.cpp tools/debugserver/debugserver.xcodeproj/project.pbxproj tools/debugserver/source/MacOSX/MachThreadList.cpp

Greg Clayton gclayton at apple.com
Sun Jan 23 23:10:48 PST 2011


Author: gclayton
Date: Mon Jan 24 01:10:48 2011
New Revision: 124115

URL: http://llvm.org/viewvc/llvm-project?rev=124115&view=rev
Log:
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.


Modified:
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/Target/Process.cpp
    lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
    lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=124115&r1=124114&r2=124115&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jan 24 01:10:48 2011
@@ -2384,6 +2384,7 @@
 			isa = PBXProject;
 			buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "lldb" */;
 			compatibilityVersion = "Xcode 3.1";
+			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				en,

Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=124115&r1=124114&r2=124115&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Mon Jan 24 01:10:48 2011
@@ -2643,9 +2643,6 @@
     
     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)

Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=124115&r1=124114&r2=124115&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Mon Jan 24 01:10:48 2011
@@ -372,6 +372,7 @@
 			isa = PBXProject;
 			buildConfigurationList = 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "debugserver" */;
 			compatibilityVersion = "Xcode 3.1";
+			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				English,

Modified: lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp?rev=124115&r1=124114&r2=124115&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/MachThreadList.cpp Mon Jan 24 01:10:48 2011
@@ -322,20 +322,36 @@
 
     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(), 





More information about the lldb-commits mailing list