Hi Richard,
On 3/4/24 7:51 PM, Richard Henderson wrote:
On 3/4/24 10:59, Gustavo Romero wrote:
Perhaps just abort for SIGABRT instead?
Although this can make a simpler test, the test can't control
the si_addr value easily, which I think is interesting to be tested.
Why do you prefer SIGABRT?
I missed that you were testing si_addr -- in which case SIGSEGV is a good match.
A test using setitimer to raise SIGALRM would test the async path.
SIGLARM doesn't generate any interesting siginfo?
It should at minimum have si_sig = SIGALRM.
gromero@arm64:~$ gdb -q ./sigalrm
Reading symbols from ./sigalrm...
(gdb) run
Starting program: /home/gromero/sigalrm
Program terminated with signal SIGALRM, Alarm clock.
The program no longer exists.
(gdb) p $_siginfo
$1 = void
Well that's because the program died.
Do you need to have gdb handle the signal?
ouch, right :)
However, on a remote target, even if I catch that signal using
'catch signal SIGALRM' the GDBstub only closes the connection
when SIGALRM is delivered. That's odd, I don't understand why.
I'm using the same binary that pretty much works on GDB locally.
[Remote target]
gromero@arm64:~$ gdb -q
gromero@arm64:~/qemu_tests$ gdb -q ./sigalrm
Reading symbols from ./sigalrm...
(gdb) catch signal SIGALRM
Catchpoint 1 (signal SIGALRM)
(gdb) c
The program is not being run.
(gdb) run
Starting program: /home/gromero/qemu_tests/sigalrm
[Inferior 1 (process 12732) exited normally]
(gdb) quit
on the QEMU gdbstub side it reports "Alarm clock":
gromero@amd:~/git/qemu/build$ ./qemu-aarch64 -g 1234 ./sigalrm -s
Alarm clock
gromero@amd:~/git/qemu/build$
[Locally]
gromero@arm64:~/qemu_tests$ gdb -q ./sigalrm
Reading symbols from ./sigalrm...
(gdb) catch signal SIGALRM
Catchpoint 1 (signal SIGALRM)
(gdb) run -s
Starting program: /home/gromero/qemu_tests/sigalrm -s
Catchpoint 1 (signal SIGALRM), 0x000000000041a410 in ualarm ()
(gdb) quit
I'd like to add for the async path using SIGALRM but I need more
time to understand what's going on regarding SIGLARM. I understand
that's nothing wrong with the Xfer:siginfo:read stub itself, and
because the main goal of the test is to test the stub, if you don't
mind, I'd like to keep only the test with SIGSEGV for v2 and leave
the async test as a follow-up.