[Lldb-commits] [lldb] r178491 - Avoid hang in attach-by-name test case

Daniel Malea daniel.malea at intel.com
Mon Apr 1 12:47:00 PDT 2013


Author: dmalea
Date: Mon Apr  1 14:47:00 2013
New Revision: 178491

URL: http://llvm.org/viewvc/llvm-project?rev=178491&view=rev
Log:
Avoid hang in attach-by-name test case
- Check that process attach succeeded before attempting to WaitForProcessToStop (observed to cause hangs on Linux)
- Update comment in TestHelloWorld case -- attaching by name still broken


Modified:
    lldb/trunk/source/API/SBTarget.cpp
    lldb/trunk/test/python_api/hello_world/TestHelloWorld.py

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=178491&r1=178490&r2=178491&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Mon Apr  1 14:47:00 2013
@@ -1114,10 +1114,13 @@ SBTarget::AttachToProcessWithName
             attach_info.GetExecutableFile().SetFile(name, false);
             attach_info.SetWaitForLaunch(wait_for);
             error.SetError (process_sp->Attach (attach_info));
-            // If we are doing synchronous mode, then wait for the
-            // process to stop!
-            if (target_sp->GetDebugger().GetAsyncExecution () == false)
-                process_sp->WaitForProcessToStop (NULL);
+            if (error.Success())
+            {
+                // If we are doing synchronous mode, then wait for the
+                // process to stop!
+                if (target_sp->GetDebugger().GetAsyncExecution () == false)
+                    process_sp->WaitForProcessToStop (NULL);
+            }
         }
         else
         {

Modified: lldb/trunk/test/python_api/hello_world/TestHelloWorld.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/hello_world/TestHelloWorld.py?rev=178491&r1=178490&r2=178491&view=diff
==============================================================================
--- lldb/trunk/test/python_api/hello_world/TestHelloWorld.py (original)
+++ lldb/trunk/test/python_api/hello_world/TestHelloWorld.py Mon Apr  1 14:47:00 2013
@@ -67,7 +67,7 @@ class HelloWorldTestCase(TestBase):
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_world_attach_with_name_api()
 
-    @expectedFailureLinux # due to bugzilla 14541
+    @expectedFailureLinux # due to bugzilla 14541 -- lldb is unable to attach to process by name
     @python_api_test
     @dwarf_test
     def test_with_dwarf_and_attach_to_process_with_name_api(self):





More information about the lldb-commits mailing list