1
0
mirror of https://github.com/golang/go synced 2024-11-26 17:16:54 -07:00

misc/ios: clean up debugger instance on failure

Also replace repeated `or` clauses with the Python idiomatic list
operator `in`.

Change-Id: I4b178f93eb92996d8b5449ee5d252543624aed9e
Reviewed-on: https://go-review.googlesource.com/111215
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Elias Naur 2018-05-03 09:48:32 +02:00
parent 8b9ecbf374
commit 64f715beb6

View File

@ -682,12 +682,14 @@ while True:
break break
sys.stderr.write(out) sys.stderr.write(out)
state = process.GetStateFromEvent(event) state = process.GetStateFromEvent(event)
if state == lldb.eStateCrashed or state == lldb.eStateDetached or state == lldb.eStateUnloaded or state == lldb.eStateExited: if state in [lldb.eStateCrashed, lldb.eStateDetached, lldb.eStateUnloaded, lldb.eStateExited]:
break break
elif state == lldb.eStateConnected: elif state == lldb.eStateConnected:
process.RemoteLaunch(args, env, None, None, None, None, 0, False, err) process.RemoteLaunch(args, env, None, None, None, None, 0, False, err)
if not err.Success(): if not err.Success():
sys.stderr.write("lldb: failed to launch remote process: %s\n" % (err)) sys.stderr.write("lldb: failed to launch remote process: %s\n" % (err))
process.Kill()
debugger.Terminate()
sys.exit(1) sys.exit(1)
# Process stops once at the beginning. Continue. # Process stops once at the beginning. Continue.
process.Continue() process.Continue()