aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/lib
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-11-30 13:57:09 -0700
committerTom Tromey <tromey@adacore.com>2023-12-11 11:44:35 -0700
commitc0a652c2aa8858dba99d578fa2fac25b1a532a0a (patch)
tree27ce9d7ad84bb16f15aff5f810454c74c5dbd945 /gdb/python/lib
parent606fc72a5f05a61184bc476dd877200336c1e3d0 (diff)
downloadbinutils-c0a652c2aa8858dba99d578fa2fac25b1a532a0a.zip
binutils-c0a652c2aa8858dba99d578fa2fac25b1a532a0a.tar.gz
binutils-c0a652c2aa8858dba99d578fa2fac25b1a532a0a.tar.bz2
Catch KeyboardInterrupt in send_gdb_with_response
Cancellation will generally be seen by the DAP code as a KeyboardInterrupt. However, this derives from BaseException and not Exception, so a small change is needed to send_gdb_with_response, to forward the exception to the DAP server thread. Reviewed-By: Kévin Le Gouguec <legouguec@adacore.com>
Diffstat (limited to 'gdb/python/lib')
-rw-r--r--gdb/python/lib/gdb/dap/startup.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/python/lib/gdb/dap/startup.py b/gdb/python/lib/gdb/dap/startup.py
index a16b51f..1d3b947 100644
--- a/gdb/python/lib/gdb/dap/startup.py
+++ b/gdb/python/lib/gdb/dap/startup.py
@@ -172,11 +172,11 @@ def send_gdb_with_response(fn):
try:
val = fn()
result_q.put(val)
- except Exception as e:
+ except (Exception, KeyboardInterrupt) as e:
result_q.put(e)
send_gdb(message)
val = result_q.get()
- if isinstance(val, Exception):
+ if isinstance(val, (Exception, KeyboardInterrupt)):
raise val
return val