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>
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