o TestHelloWorld.py:

  Add a test case for the SBTarget::AttachToProcessWithID() API call.

o main.c:

  The change goes with the added test case test_with_dwarf_and_attach_to_process_with_id_api() above.

o SBTarget.cpp:

  Checks whether we're in synchronous mode.  If yes, let's wait for the process to stop right after attaching.


git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@133223 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 629308f..78b67db 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -290,6 +290,10 @@
         if (sb_process.IsValid())
         {
             error.SetError (sb_process->Attach (pid));
+            // If we are doing synchronous mode, then wait for the
+            // process to stop!
+            if (m_opaque_sp->GetDebugger().GetAsyncExecution () == false)
+                sb_process->WaitForProcessToStop (NULL);
         }
         else
         {