aboutsummaryrefslogtreecommitdiff
path: root/misc/ios
diff options
context:
space:
mode:
authorElias Naur <elias.naur@gmail.com>2018-05-03 09:48:32 +0200
committerElias Naur <elias.naur@gmail.com>2018-05-03 15:15:27 +0000
commit64f715beb6551f91c271a47b6c2c62dedf27fadf (patch)
treecd1fbacaa0ab1aa3993f782b02167e5edda6b0d4 /misc/ios
parent8b9ecbf374d2c8be1423c24a235d6e3ff8bafe15 (diff)
downloadgo-64f715beb6551f91c271a47b6c2c62dedf27fadf.tar.gz
go-64f715beb6551f91c271a47b6c2c62dedf27fadf.zip
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>
Diffstat (limited to 'misc/ios')
-rw-r--r--misc/ios/go_darwin_arm_exec.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/ios/go_darwin_arm_exec.go b/misc/ios/go_darwin_arm_exec.go
index 8e0526867d..675b8d26fa 100644
--- a/misc/ios/go_darwin_arm_exec.go
+++ b/misc/ios/go_darwin_arm_exec.go
@@ -682,12 +682,14 @@ while True:
break
sys.stderr.write(out)
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
elif state == lldb.eStateConnected:
process.RemoteLaunch(args, env, None, None, None, None, 0, False, err)
if not err.Success():
sys.stderr.write("lldb: failed to launch remote process: %s\n" % (err))
+ process.Kill()
+ debugger.Terminate()
sys.exit(1)
# Process stops once at the beginning. Continue.
process.Continue()