This changes the DAP code to explicitly request that gdb exit.
Previously this could cause crashes, but with the previous cleanups,
this should no longer happen.
This also adds a tests that ensures that gdb exits with status 0.
# 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):
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
}