forked from OSchip/llvm-project
Work in progress for:
rdar://problem/10577182 Audit lldb API impl for places where we need to perform a NULL check Add a NULL check for SBTarget.AttachToProcessWithName() so it will not hang. llvm-svn: 146948
This commit is contained in:
parent
00723591b8
commit
3ac503e042
|
@ -379,7 +379,7 @@ SBTarget::AttachToProcessWithName
|
|||
)
|
||||
{
|
||||
SBProcess sb_process;
|
||||
if (m_opaque_sp)
|
||||
if (name && m_opaque_sp)
|
||||
{
|
||||
Mutex::Locker api_locker (m_opaque_sp->GetAPIMutex());
|
||||
|
||||
|
|
|
@ -155,6 +155,13 @@ class HelloWorldTestCase(TestBase):
|
|||
error = lldb.SBError()
|
||||
# Pass 'False' since we don't want to wait for new instance of "hello_world" to be launched.
|
||||
name = os.path.basename(self.exe)
|
||||
|
||||
# While we're at it, make sure that passing a None as the process name
|
||||
# does not hang LLDB.
|
||||
target.AttachToProcessWithName(listener, None, False, error)
|
||||
# Also boundary condition test ConnectRemote(), too.
|
||||
target.ConnectRemote(listener, None, None, error)
|
||||
|
||||
process = target.AttachToProcessWithName(listener, name, False, error)
|
||||
|
||||
self.assertTrue(error.Success() and process, PROCESS_IS_VALID)
|
||||
|
|
Loading…
Reference in New Issue