summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debuginfo-tests/llgdb.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/debuginfo-tests/llgdb.py b/debuginfo-tests/llgdb.py
index 7d4fdd64fd1..5f14497f628 100644
--- a/debuginfo-tests/llgdb.py
+++ b/debuginfo-tests/llgdb.py
@@ -58,6 +58,12 @@ args = parser.parse_args()
debugger = lldb.SBDebugger.Create()
debugger.SkipLLDBInitFiles(args.n)
+# Make sure to clean up the debugger on exit.
+import atexit
+def on_exit():
+ debugger.Terminate()
+atexit.register(on_exit)
+
# Don't return from lldb function calls until the process stops.
debugger.SetAsync(False)
@@ -150,7 +156,6 @@ NOTE: There are several reasons why this may happen:
print debugger.HandleCommand(' '.join(cmd))
except SystemExit:
- lldb.SBDebugger_Terminate()
raise
except:
print 'Could not handle the command "%s"' % ' '.join(cmd)
OpenPOWER on IntegriCloud