diff options
author | Adrian Prantl <aprantl@apple.com> | 2019-06-17 20:06:34 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2019-06-17 20:06:34 +0000 |
commit | 2d26cf37d777c9e6c4f89144b506a153b010d495 (patch) | |
tree | ebe7ce081bc0af07af174a3b7b74b04d935d7c69 /debuginfo-tests | |
parent | 72adaf3ec855a5c7877ee436f99975b0456d4bf6 (diff) | |
download | bcm5719-llvm-2d26cf37d777c9e6c4f89144b506a153b010d495.tar.gz bcm5719-llvm-2d26cf37d777c9e6c4f89144b506a153b010d495.zip |
llgdb.py: Make sure to clean up the debugger on exit.
<rdar://problem/51807962>
llvm-svn: 363611
Diffstat (limited to 'debuginfo-tests')
-rw-r--r-- | debuginfo-tests/llgdb.py | 7 |
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) |