aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/python/lib/gdb/dap/server.py1
-rw-r--r--gdb/testsuite/lib/dap-support.exp9
2 files changed, 10 insertions, 0 deletions
diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index 6757f29..19840f4 100644
--- a/gdb/python/lib/gdb/dap/server.py
+++ b/gdb/python/lib/gdb/dap/server.py
@@ -230,6 +230,7 @@ class Server:
# responses are flushed to the client before exiting.
self.write_queue.put(None)
json_writer.join()
+ send_gdb("quit")
@in_dap_thread
def send_event_later(self, event, body=None):
diff --git a/gdb/testsuite/lib/dap-support.exp b/gdb/testsuite/lib/dap-support.exp
index 89a4b0e..61355b5 100644
--- a/gdb/testsuite/lib/dap-support.exp
+++ b/gdb/testsuite/lib/dap-support.exp
@@ -403,6 +403,15 @@ proc dap_check_log_file_re { re } {
proc dap_shutdown {{terminate false}} {
dap_check_request_and_response "shutdown" disconnect \
[format {o terminateDebuggee [l %s]} $terminate]
+
+ # Check gdb's exit status.
+ global gdb_spawn_id
+ set result [wait -i $gdb_spawn_id]
+ gdb_assert {[lindex $result 2] == 0}
+ gdb_assert {[lindex $result 3] == 0}
+
+ clear_gdb_spawn_id
+
dap_check_log_file
}