From: Martin Simmons Date: Wed, 5 Nov 2014 14:47:39 +0000 (+0000) Subject: gdbstub: Add a missing case of signal number translation in gdbstub X-Git-Tag: qemu-xen-4.6.0-rc1~79^2~6 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=f17b06901049e54dbfa8b01c278cdc2e3ae5d62d;p=qemu-upstream-unstable.git gdbstub: Add a missing case of signal number translation in gdbstub While using qemu with gdb "target remote" to debug an application that uses fork and exec, the qemu process receives SIGSTOP every time the forked process terminates (sending SIGCHLD). This is caused by a missing call to gdb_signal_to_target in gdbstub.c, which is fixed by this patch: Signed-off-by: Martin Simmons Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- diff --git a/gdbstub.c b/gdbstub.c index d1b5afd8f..0faca568d 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -823,7 +823,10 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) action = *p++; signal = 0; if (action == 'C' || action == 'S') { - signal = strtoul(p, (char **)&p, 16); + signal = gdb_signal_to_target(strtoul(p, (char **)&p, 16)); + if (signal == -1) { + signal = 0; + } } else if (action != 'c' && action != 's') { res = 0; break;