]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Use signal information to determine SIGTRAP type for FreeBSD.
authorJohn Baldwin <jhb@FreeBSD.org>
Sun, 4 Mar 2018 05:25:33 +0000 (21:25 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Sun, 4 Mar 2018 05:25:33 +0000 (21:25 -0800)
commit7efba073e2b83803a47fd89e701fe60b98f2debc
treec1ae1f2acffd1e992077ef2e03bd549f0690c73d
parent386a86761838df16c1459275d465ed21a1c35d9f
Use signal information to determine SIGTRAP type for FreeBSD.

Use the signal code from siginfo_t to distinguish SIGTRAP events due
to trace traps (TRAP_TRACE) and software breakpoints (TRAP_BRKPT).
For software breakpoints, adjust the PC when the event is reported as
part of the API when supplying "stopped_by_sw_breakpoint".  Currently
FreeBSD only supports hardware watchpoints and breakpoints on x86
which are reported as trace traps.  Signal information is not used on
MIPS and sparc64 kernels which do not reliably report TRAP_BRKPT for
software breakpoints.

gdb/ChangeLog:

* fbsd-nat.c: Include "inf-ptrace.h".
(USE_SIGTRAP_SIGINFO): Conditionally define.
[USE_SIGTRAP_SIGINFO] (fbsd_handle_debug_trap): New function.
(fbsd_wait) [USE_SIGTRAP_SIGINFO]: Call "fbsd_handle_debug_trap".
[USE_SIGTRAP_SIGINFO] (fbsd_stopped_by_sw_breakpoint): New
function.
[USE_SIGTRAP_SIGINFO] (fbsd_supports_stopped_by_sw_breakpoint):
Likewise.
[USE_SIGTRAP_SIGINFO] (fbsd_supports_stopped_by_hw_breakpoint):
Likewise.
(fbsd_nat_add_target) [USE_SIGTRAP_SIGINFO]: Set
"stopped_by_sw_breakpoint", "supports_stopped_by_sw_breakpoint",
"supports_stopped_by_hw_breakpoint" target methods.
gdb/ChangeLog
gdb/fbsd-nat.c