From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36512) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsXFF-0002Ba-LP for qemu-devel@nongnu.org; Sun, 23 Nov 2014 08:30:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XsXF5-00080U-MN for qemu-devel@nongnu.org; Sun, 23 Nov 2014 08:30:29 -0500 Received: from mail-pd0-x22b.google.com ([2607:f8b0:400e:c02::22b]:62045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XsXF5-00080H-GK for qemu-devel@nongnu.org; Sun, 23 Nov 2014 08:30:19 -0500 Received: by mail-pd0-f171.google.com with SMTP id y13so138340pdi.2 for ; Sun, 23 Nov 2014 05:30:18 -0800 (PST) Received: from [192.168.2.3] ([123.110.214.155]) by mx.google.com with ESMTPSA id pk1sm9765812pdb.78.2014.11.23.05.30.15 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Nov 2014 05:30:16 -0800 (PST) Message-ID: <5471E166.90705@gmail.com> Date: Sun, 23 Nov 2014 21:30:14 +0800 From: "Wei-cheng, Wang" MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [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 Ping? On 10/27/2014 12:58 AM, Wei-cheng Wang wrote: > 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 >