* [Qemu-devel] [PATCH] gdbstub: Convert gdb-signal to target signal when continuing.
@ 2014-10-26 16:58 Wei-cheng Wang
2014-11-23 13:30 ` Wei-cheng, Wang
0 siblings, 1 reply; 3+ messages in thread
From: Wei-cheng Wang @ 2014-10-26 16:58 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] gdbstub: Convert gdb-signal to target signal when continuing.
2014-10-26 16:58 [Qemu-devel] [PATCH] gdbstub: Convert gdb-signal to target signal when continuing Wei-cheng Wang
@ 2014-11-23 13:30 ` Wei-cheng, Wang
2014-11-23 13:46 ` Wei-cheng Wang
0 siblings, 1 reply; 3+ messages in thread
From: Wei-cheng, Wang @ 2014-11-23 13:30 UTC (permalink / raw)
To: qemu-devel
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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] gdbstub: Convert gdb-signal to target signal when continuing.
2014-11-23 13:30 ` Wei-cheng, Wang
@ 2014-11-23 13:46 ` Wei-cheng Wang
0 siblings, 0 replies; 3+ messages in thread
From: Wei-cheng Wang @ 2014-11-23 13:46 UTC (permalink / raw)
To: qemu-devel
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
>>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-11-23 13:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-26 16:58 [Qemu-devel] [PATCH] gdbstub: Convert gdb-signal to target signal when continuing Wei-cheng Wang
2014-11-23 13:30 ` Wei-cheng, Wang
2014-11-23 13:46 ` Wei-cheng Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.