aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-07-25 09:16:35 -0600
committerTom Tromey <tromey@adacore.com>2023-08-01 12:56:52 -0600
commit21db866dc69c481cd79b4d739c2170a7ef9b98fd (patch)
treea88d2526976cb7846d1ea793c044f5c7e62ee6bc /gdb/python
parent8a8a5ccadd18b9f1ecb7943bf56fad29c6f529bc (diff)
downloadgdb-21db866dc69c481cd79b4d739c2170a7ef9b98fd.zip
gdb-21db866dc69c481cd79b4d739c2170a7ef9b98fd.tar.gz
gdb-21db866dc69c481cd79b4d739c2170a7ef9b98fd.tar.bz2
Implement DAP 'terminated' event
This implements the DAP 'terminated' event. Vladimir Makaev noticed that VSCode will not report the debug session as over unless this is sent. It's not completely clear when exactly this event ought to be sent. Here I've done it when the inferior exits. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30681
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/lib/gdb/dap/events.py1
-rw-r--r--gdb/python/lib/gdb/dap/server.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/gdb/python/lib/gdb/dap/events.py b/gdb/python/lib/gdb/dap/events.py
index 10c8a34..aca2512 100644
--- a/gdb/python/lib/gdb/dap/events.py
+++ b/gdb/python/lib/gdb/dap/events.py
@@ -32,6 +32,7 @@ def _on_exit(event):
"exitCode": code,
},
)
+ send_event("terminated")
@in_gdb_thread
diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index b1c75ab..db7893a 100644
--- a/gdb/python/lib/gdb/dap/server.py
+++ b/gdb/python/lib/gdb/dap/server.py
@@ -151,7 +151,7 @@ class Server:
self.done = True
-def send_event(event, body):
+def send_event(event, body=None):
"""Send an event to the DAP client.
EVENT is the name of the event, a string.
BODY is the body of the event, an arbitrary object."""