[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] gdbstub: Convert gdb-signal to target signal wh
From: |
Wei-cheng Wang |
Subject: |
Re: [Qemu-devel] [PATCH] gdbstub: Convert gdb-signal to target signal when continuing. |
Date: |
Sun, 23 Nov 2014 21:46:37 +0800 |
Never mind. I just found Martin Simmons fixed the same issue.
On Sun, Nov 23, 2014 at 9:30 PM, Wei-cheng, Wang <address@hidden> 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 <address@hidden>
>> 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 <address@hidden>
>> ---
>> 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
>>
>