From ac4fd1b4fd964a3306381174a298f0c2db7e9964 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 19 Jan 2025 15:12:00 +0100 Subject: [PATCH] Signal stopped thread --- src/gdb-stub/gdb_stub.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gdb-stub/gdb_stub.cpp b/src/gdb-stub/gdb_stub.cpp index 2652616e..c09e1a55 100644 --- a/src/gdb-stub/gdb_stub.cpp +++ b/src/gdb-stub/gdb_stub.cpp @@ -190,18 +190,25 @@ namespace gdb_stub connection.send_reply(res ? "OK" : "E01"); } + void signal_stop(connection_handler& connection, debugging_handler& handler) + { + const auto id = handler.get_current_thread_id(); + const auto hex_id = utils::string::to_hex_number(id); + connection.send_reply("T05thread:" + hex_id + ";"); + } + void continue_execution(connection_handler& connection, async_handler& async, debugging_handler& handler) { async.run(); process_action(connection, handler.run()); async.pause(); - connection.send_reply("S05"); + signal_stop(connection, handler); } void singlestep_execution(connection_handler& connection, debugging_handler& handler) { process_action(connection, handler.singlestep()); - connection.send_reply("S05"); + signal_stop(connection, handler); } void handle_v_packet(connection_handler& connection, async_handler& async, debugging_handler& handler, @@ -470,7 +477,7 @@ namespace gdb_stub break; case '?': - connection.send_reply("S05"); + signal_stop(connection, handler); break; case 'v':