From 8b7fcb8ed159d1caeb0b6e5b753b539d65092282 Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Wed, 7 Feb 2024 16:38:09 +0000 Subject: gdbstub: Allow specifying a reason in stop packets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The upcoming syscall catchpoint support needs to send stop packets with an associated reason to GDB. Add an extra parameter to gdb_handlesig() for that, and rename it to gdb_handlesig_reason(). Provide a compatibility wrapper with an old name. Signed-off-by: Ilya Leoshkevich Message-Id: <20240202152506.279476-3-iii@linux.ibm.com> Signed-off-by: Alex Bennée Message-Id: <20240207163812.3231697-12-alex.bennee@linaro.org> --- gdbstub/user.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gdbstub') diff --git a/gdbstub/user.c b/gdbstub/user.c index dbe1d9b..63edca1 100644 --- a/gdbstub/user.c +++ b/gdbstub/user.c @@ -121,7 +121,7 @@ void gdb_qemu_exit(int code) exit(code); } -int gdb_handlesig(CPUState *cpu, int sig) +int gdb_handlesig_reason(CPUState *cpu, int sig, const char *reason) { char buf[256]; int n; @@ -141,6 +141,9 @@ int gdb_handlesig(CPUState *cpu, int sig) "T%02xthread:", gdb_target_signal_to_gdb(sig)); gdb_append_thread_id(cpu, gdbserver_state.str_buf); g_string_append_c(gdbserver_state.str_buf, ';'); + if (reason) { + g_string_append(gdbserver_state.str_buf, reason); + } gdb_put_strbuf(); gdbserver_state.allow_stop_reply = false; } -- cgit v1.1