From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiR8y-00044f-Q3 for qemu-devel@nongnu.org; Sun, 26 Oct 2014 12:58:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XiR8x-0002QM-O7 for qemu-devel@nongnu.org; Sun, 26 Oct 2014 12:58:16 -0400 Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:46166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XiR8x-0002Op-Fh for qemu-devel@nongnu.org; Sun, 26 Oct 2014 12:58:15 -0400 Received: by mail-la0-f42.google.com with SMTP id gf13so5588477lab.1 for ; Sun, 26 Oct 2014 09:58:13 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 27 Oct 2014 00:58:13 +0800 Message-ID: From: Wei-cheng Wang Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] [PATCH] gdbstub: Convert gdb-signal to target signal when continuing. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org QEMU should convert signal number reciving from GDB cilent from gdb-signal number to target sginal number - using gdb_signal_to_target(). In this case, GDB_SIG_BUS is 10. However, 10 is SIGUSR1 for target. So QEMU continues with the wrong signal number. #include #include void handle_signal (int sig) { puts ("Hello"); } int main () { signal (SIGBUS, handle_signal); kill (0, SIGBUS); return 0; } (gdb) target remote :25566 Remote debugging using :25566 0x00008b98 in _start () (gdb) c Continuing. Program received signal SIGBUS, Bus error. 0x0000e18c in kill () (gdb) c Continuing. Program terminated with signal SIGUSR1, User defined signal 1. ^^^^^^^ The program no longer exists. (gdb) Thansk, Wei-cheng Wang From: Cole Wang Date: Mon, 27 Oct 2014 00:33:18 +0800 Subject: [PATCH] gdbstub: Convert gdb-signal to target signal when continuing. Signed-off-by: Wei-cheng Wang --- gdbstub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdbstub.c b/gdbstub.c index d1b5afd..cce5c69 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -851,7 +851,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) if (res == 's') { cpu_single_step(s->c_cpu, sstep_flags); } - s->signal = res_signal; + s->signal = gdb_signal_to_target(res_signal); gdb_continue(s); return RS_IDLE; } -- 1.9.1