Message ID | CAPmZyH7tf78Te2PiX5uUQzL1vD1Vwa5LG0yahrgp4HVPh=XNxw@mail.gmail.com |
---|---|
State | New |
Headers | show |
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 <stdio.h> > #include <signal.h> > > 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 <cole945@gmail.com> > 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 <cole945@gmail.com> > --- > 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 >
Never mind. I just found Martin Simmons fixed the same issue. On Sun, Nov 23, 2014 at 9:30 PM, Wei-cheng, Wang <cole945@gmail.com> wrote: > 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 <stdio.h> >> #include <signal.h> >> >> 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 <cole945@gmail.com> >> 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 <cole945@gmail.com> >> --- >> 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 >> >
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;