From 64f715beb6551f91c271a47b6c2c62dedf27fadf Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Thu, 3 May 2018 09:48:32 +0200 Subject: [PATCH] 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 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- misc/ios/go_darwin_arm_exec.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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() -- 2.50.0