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
This commit is contained in:
Daniel Malea 2013-04-01 19:47:00 +00:00
parent 5d5b67c52c
commit d659dc16cc
2 changed files with 8 additions and 5 deletions

View File

@ -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
{

View File

@ -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):