diff options
author | Daniel Malea <daniel.malea@intel.com> | 2013-04-01 19:47:00 +0000 |
---|---|---|
committer | Daniel Malea <daniel.malea@intel.com> | 2013-04-01 19:47:00 +0000 |
commit | d659dc16cc0896b66d50d25abe7cb4adde2d8180 (patch) | |
tree | e4b01d6b0a011dacb24eb4c0a2a21f6e8bdf0cba /lldb/source/API/SBTarget.cpp | |
parent | 5d5b67c52cd2e1fc1ef2342a4480938a70f0d2ec (diff) | |
download | bcm5719-llvm-d659dc16cc0896b66d50d25abe7cb4adde2d8180.tar.gz bcm5719-llvm-d659dc16cc0896b66d50d25abe7cb4adde2d8180.zip |
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
llvm-svn: 178491
Diffstat (limited to 'lldb/source/API/SBTarget.cpp')
-rw-r--r-- | lldb/source/API/SBTarget.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp index f7d6bca55f0..8687cad69bf 100644 --- a/lldb/source/API/SBTarget.cpp +++ b/lldb/source/API/SBTarget.cpp @@ -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 { |