diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2024-02-07 16:38:09 +0000 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2024-02-09 17:52:40 +0000 |
commit | 8b7fcb8ed159d1caeb0b6e5b753b539d65092282 (patch) | |
tree | e0e5cfa907a3fb4f8f751856e80b00eeb6ddcf77 /gdbstub | |
parent | 4aad096587a28ef967f319279bca78e2b216b7f3 (diff) |
gdbstub: Allow specifying a reason in stop packets
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 <iii@linux.ibm.com>
Message-Id: <20240202152506.279476-3-iii@linux.ibm.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20240207163812.3231697-12-alex.bennee@linaro.org>
Diffstat (limited to 'gdbstub')
-rw-r--r-- | gdbstub/user.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdbstub/user.c b/gdbstub/user.c index dbe1d9b887..63edca131a 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; } |