Rework signal frame probing for FreeBSD/x86
authorJohn Baldwin <jhb@freebsd.org>
Wed, 25 Feb 2015 14:51:42 +0000 (09:51 -0500)
committerPedro Alves <palves@redhat.com>
Thu, 26 Feb 2015 11:10:25 +0000 (11:10 +0000)
commitcf424aef0af89903abdd6c4e055684929e4990af
tree2dd568a48d7a0ee4bd6d523e9acb7b09e62fe332
parentc5cb74eeb3ea13a9fbeb0ec26b5bad10c4b92e4a
Rework signal frame probing for FreeBSD/x86

- Use signal frame sniffers that look for the signal trampoline
  instruction sequence to detect most signal frames.

- FreeBSD kernels between 9.2 and 10.1 inclusive do not include the
  signal trampoline code in process core dumps.  To detect signal
  frames for core dumps under these kernels, use the
  kern.proc.sigtramp.<pid> sysctl to fetch the location of the signal
  trampoline in the gdb process and assume that PC values within this
  location are signal frames.  This depends on that location being
  identical for all binaries.

gdb/ChangeLog:
2015-02-25  John Baldwin  <jhb@FreeBSD.org>

* amd64fbsd-nat.c: Include sys/user.h.
(_initialize_amd64fbsd_nat): Use the KERN_PROC_SIGTRAMP sysctl
instead of KERN_PS_STRINGS to locate the signal trampoline.
* i386fbsd-nat.c: Include sys/user.h.
(_initialize_i386fbsd_nat): Use the KERN_PROC_SIGTRAMP sysctl
instead of KERN_PS_STRINGS to locate the signal trampoline.
* amd64fbsd-tdep.c (amd64fbsd_sigtramp_code): New.
(amd64fbsd_sigtramp_p): New.
(amd64fbsd_sigtramp_start_addr, amd64fbsd_sigtramp_end_addr): No
longer set default values.
(amd64fbsd_init_abi): Set "sigtramp_p" to "amd64fbsd_sigtramp_p".
* i386fbsd-tdep.c (i386fbsd_sigtramp_start)
(i386fbsd_sigtramp_middle, i386fbsd_sigtramp_end)
(i386fbsd_freebsd4_sigtramp_start)
(i386fbsd_freebsd4_sigtramp_middle)
(i386fbsd_freebsd4_sigtramp_end, i386fbsd_osigtramp_start)
(i386fbsd_osigtramp_middle, i386fbsd_osigtramp_end): New.
(i386fbsd_sigtramp_p): New.
(i386fbsd_sigtramp_start_addr, i386fbsd_sigtramp_end_addr): No
longer set default values.
(i386fbsd_init_abi): Set "sigtramp_p" to "i386fbsd_sigtramp_p".
gdb/ChangeLog
gdb/amd64fbsd-nat.c
gdb/amd64fbsd-tdep.c
gdb/i386fbsd-nat.c
gdb/i386fbsd-tdep.c
This page took 0.036288 seconds and 4 git commands to generate.