Fixes #219 - iOS 9.3 app hangs on splash screen

Fixes cases where process is not yet running.

Signed-off-by: Shazron Abdullah <shazron@apache.org>
This commit is contained in:
Alexis Kofman 2016-04-05 21:32:53 +02:00 committed by Shazron Abdullah
parent 3ef9dfefcf
commit 76e8d08e43

View File

@ -42,20 +42,15 @@ def run_command(debugger, command, result, internal_dict):
def safequit_command(debugger, command, result, internal_dict):
process = lldb.target.process
listener = debugger.GetListener()
listener.StartListeningForEvents(process.GetBroadcaster(), lldb.SBProcess.eBroadcastBitStateChanged | lldb.SBProcess.eBroadcastBitSTDOUT | lldb.SBProcess.eBroadcastBitSTDERR)
event = lldb.SBEvent()
while True:
if listener.WaitForEvent(1, event) and lldb.SBProcess.EventIsProcessEvent(event):
state = lldb.SBProcess.GetStateFromEvent(event)
else:
state = process.GetState()
if state == lldb.eStateRunning:
process.Detach()
os._exit(0)
elif state > lldb.eStateRunning:
os._exit(state)
state = process.GetState()
if state == lldb.eStateRunning:
process.Detach()
os._exit(0)
elif state > lldb.eStateRunning:
os._exit(state)
else:
print('\\nApplication has not been launched\\n')
os._exit(1)
def autoexit_command(debugger, command, result, internal_dict):
process = lldb.target.process