Fwd: [PATCH] [PR gdb/23093] Implementation of "gdbarch_gdb_signal_to/from_target" on FreeBSD

Rajendra SY rajendra.sy@gmail.com
Fri Apr 20 09:50:00 GMT 2018


<patch attached>

Problem:
The $_exitsignal internal variable does not get updated on FreeBSD platform.

Cause:
FreeBSD target is missing signal mapping functions
"gdb_signal_to_target" & "gdb_signal_from_target".
The code flow gdb/infrun.c:5075 [a call to
gdbarch_gdb_signal_to_target_p()] tries to find out if the target has
these functions. In case of FreeBSD it is not so it just skips
updating '$_exitsignal' variable.
The attached patch implements these functions to provide correct
FreeBSD signal to GDB signal mapping information.

Tests:
FAIL: gdb.base/exitsignal.exp: $_exitsignal is 11 (SIGSEGV) after SIGSEGV.
FAIL: gdb.base/exitsignal.exp: $_exitsignal is 11 (SIGSEGV) after
restarting the inferior

These above currently failing tests will pass with this fix.

gdb/ChangeLog:
2018-04-20  Rajendra SY  <rajendra.sy@gmail.com>

        PR gdb/23093
        * gdb/fbsd-tdep.c (enum gdb_signal):
        (fbsd_gdb_signal_from_target):
        (fbsd_gdb_signal_to_target):
        (fbsd_init_abi):
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gdb_exitsignal.diff
Type: application/octet-stream
Size: 7709 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20180420/ea84c04c/attachment.obj>


More information about the Gdb-patches mailing list