]> Cypherpunks repositories - gostls13.git/commitdiff
misc/ios: clean up debugger instance on failure
authorElias Naur <elias.naur@gmail.com>
Thu, 3 May 2018 07:48:32 +0000 (09:48 +0200)
committerElias Naur <elias.naur@gmail.com>
Thu, 3 May 2018 15:15:27 +0000 (15:15 +0000)
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>
misc/ios/go_darwin_arm_exec.go

index 8e0526867d846fa47ffc8fbd277515b69e2fa5b2..675b8d26faa19bdab6b36a3ae46c3f6837d77b16 100644 (file)
@@ -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()