[Lldb-commits] [lldb] r113022 - in /lldb/trunk: source/Core/Debugger.cpp source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp test/lldbtest.py

Johnny Chen johnny.chen at apple.com
Fri Sep 3 15:35:47 PDT 2010


Author: johnny
Date: Fri Sep  3 17:35:47 2010
New Revision: 113022

URL: http://llvm.org/viewvc/llvm-project?rev=113022&view=rev
Log:
Fixed an lldb infrastructure bug, where the debugger should reaaly update its
execution context only when the process is still alive.  When running the test
suite, the debugger is launching and killing processes constantly.

This might be the cause of the test hang as reported in rdar://problem/8377854,
where the debugger was looping infinitely trying to update a supposedly stale
thread list.

Modified:
    lldb/trunk/source/Core/Debugger.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/trunk/test/lldbtest.py

Modified: lldb/trunk/source/Core/Debugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Debugger.cpp?rev=113022&r1=113021&r2=113022&view=diff
==============================================================================
--- lldb/trunk/source/Core/Debugger.cpp (original)
+++ lldb/trunk/source/Core/Debugger.cpp Fri Sep  3 17:35:47 2010
@@ -479,7 +479,7 @@
         {
             m_exe_ctx.target = target_sp.get();
             m_exe_ctx.process = target_sp->GetProcessSP().get();
-            if (m_exe_ctx.process && m_exe_ctx.process->IsRunning() == false)
+            if (m_exe_ctx.process && m_exe_ctx.process->IsAlive() && !m_exe_ctx.process->IsRunning())
             {
                 m_exe_ctx.thread = m_exe_ctx.process->GetThreadList().GetSelectedThread().get();
                 if (m_exe_ctx.thread == NULL)

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=113022&r1=113021&r2=113022&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Fri Sep  3 17:35:47 2010
@@ -1171,6 +1171,7 @@
     StopAsyncThread ();
     m_gdb_comm.StopReadThread();
     KillDebugserverProcess ();
+    m_gdb_comm.Disconnect();    // Disconnect from the debug server.
     return error;
 }
 

Modified: lldb/trunk/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbtest.py?rev=113022&r1=113021&r2=113022&view=diff
==============================================================================
--- lldb/trunk/test/lldbtest.py (original)
+++ lldb/trunk/test/lldbtest.py Fri Sep  3 17:35:47 2010
@@ -355,12 +355,12 @@
                 else:
                     print >> sys.stderr, self.res.GetError()
 
+            if running:
+                # For process launch, wait some time before possible next try.
+                time.sleep(self.timeWait)
+
             if self.res.Succeeded():
                 break
-            else:
-                if running:
-                    # Process launch failed, wait some time before the next try.
-                    time.sleep(self.timeWait)
 
         # Modify runStarted only if "run" or "process launch" was encountered.
         if running:





More information about the lldb-commits mailing list