mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00:00
gdbstub: Switch to the thread receiving a signal
Respond with Txxthread:yyyy; instead of a plain Sxx to indicate which thread received the signal. Otherwise, the debugger will associate it with the main one. Also automatically select this thread, as that is what gdb expects. Signed-off-by: Pavel Labath <pavel@labath.sk> Message-Id: <20211019174953.36560-1-pavel@labath.sk> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20211026102234.3961636-29-alex.bennee@linaro.org>
This commit is contained in:
committed by
Alex Bennée
parent
8ef3fdf952
commit
4a82be77de
@@ -3138,8 +3138,12 @@ gdb_handlesig(CPUState *cpu, int sig)
|
||||
tb_flush(cpu);
|
||||
|
||||
if (sig != 0) {
|
||||
snprintf(buf, sizeof(buf), "S%02x", target_signal_to_gdb(sig));
|
||||
put_packet(buf);
|
||||
gdb_set_stop_cpu(cpu);
|
||||
g_string_printf(gdbserver_state.str_buf,
|
||||
"T%02xthread:", target_signal_to_gdb(sig));
|
||||
gdb_append_thread_id(cpu, gdbserver_state.str_buf);
|
||||
g_string_append_c(gdbserver_state.str_buf, ';');
|
||||
put_strbuf();
|
||||
}
|
||||
/* put_packet() might have detected that the peer terminated the
|
||||
connection. */
|
||||
|
||||
Reference in New Issue
Block a user