From 9871c759e07fd6ad6912f227f3ddcba53c4dc5a4 Mon Sep 17 00:00:00 2001 From: Alexis Kofman Date: Tue, 5 Apr 2016 21:32:53 +0200 Subject: [PATCH] Fixes #219 - iOS 9.3 app hangs on splash screen Fixes cases where process is not yet running. Signed-off-by: Shazron Abdullah --- src/scripts/lldb.py | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/scripts/lldb.py b/src/scripts/lldb.py index ec02219..6189a3d 100644 --- a/src/scripts/lldb.py +++ b/src/scripts/lldb.py @@ -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