This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Use signal information to determine SIGTRAP type for FreeBSD.
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Sun, 04 Mar 2018 01:38:29 -0500
- Subject: [binutils-gdb] Use signal information to determine SIGTRAP type for FreeBSD.
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT 7efba073e2b83803a47fd89e701fe60b98f2debc ***
Author: John Baldwin <jhb@FreeBSD.org>
Branch: master
Commit: 7efba073e2b83803a47fd89e701fe60b98f2debc
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.