aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/lib
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/lib')
-rw-r--r--gdb/python/lib/gdb/dap/io.py2
-rw-r--r--gdb/python/lib/gdb/dap/server.py3
-rw-r--r--gdb/python/lib/gdb/dap/startup.py1
3 files changed, 4 insertions, 2 deletions
diff --git a/gdb/python/lib/gdb/dap/io.py b/gdb/python/lib/gdb/dap/io.py
index 4edd504..81e835c 100644
--- a/gdb/python/lib/gdb/dap/io.py
+++ b/gdb/python/lib/gdb/dap/io.py
@@ -79,4 +79,4 @@ def start_json_writer(stream, queue):
stream.write(body_bytes)
stream.flush()
- start_thread("JSON writer", _json_writer)
+ return start_thread("JSON writer", _json_writer)
diff --git a/gdb/python/lib/gdb/dap/server.py b/gdb/python/lib/gdb/dap/server.py
index 7cc5a46..e711066 100644
--- a/gdb/python/lib/gdb/dap/server.py
+++ b/gdb/python/lib/gdb/dap/server.py
@@ -212,7 +212,7 @@ class Server:
# Before looping, start the thread that writes JSON to the
# client, and the thread that reads output from the inferior.
start_thread("output reader", self._read_inferior_output)
- start_json_writer(self.out_stream, self.write_queue)
+ json_writer = start_json_writer(self.out_stream, self.write_queue)
start_thread("JSON reader", self._reader_thread)
while not self.done:
cmd = self.read_queue.get()
@@ -229,6 +229,7 @@ class Server:
# JSON-writing thread, so that we can ensure that all
# responses are flushed to the client before exiting.
self.write_queue.put(None)
+ json_writer.join()
@in_dap_thread
def send_event_later(self, event, body=None):
diff --git a/gdb/python/lib/gdb/dap/startup.py b/gdb/python/lib/gdb/dap/startup.py
index 6049121..0a42c91 100644
--- a/gdb/python/lib/gdb/dap/startup.py
+++ b/gdb/python/lib/gdb/dap/startup.py
@@ -80,6 +80,7 @@ def start_thread(name, target, args=()):
result = gdb.Thread(name=name, target=thread_wrapper, args=args, daemon=True)
result.start()
+ return result
def start_dap(target):