aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Simmons <martin@lispworks.com>2014-11-05 14:47:39 +0000
committerMichael Tokarev <mjt@tls.msk.ru>2014-11-11 08:58:30 +0300
commitf17b06901049e54dbfa8b01c278cdc2e3ae5d62d (patch)
tree6a38ea666a1926e91b84f25e4bcb6ad8bb9cf2b3
parent5b009e400809523e71f1b72bdaa2b681e2a5b1c7 (diff)
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 <martin@lispworks.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--gdbstub.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdbstub.c b/gdbstub.c
index d1b5afd8fe..0faca568d9 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;