[0/3] Use signal information to determine SIGTRAP type on FreeBSD

Message ID 20180228014656.32372-1-jhb@FreeBSD.org
Headers show
Series
  • Use signal information to determine SIGTRAP type on FreeBSD
Related show

Message

John Baldwin Feb. 28, 2018, 1:46 a.m.
Use the signal information for a SIGTRAP signal to determine when an
event in a child process is a breakpoint event versus another event.
FreeBSD currently doesn't have a TRAP_HWBKPT (though I'm working on
fixing that), so this patchset queries the x86 debug registers on x86
platforms for a SIGTRAP signal a TRAP_TRACE signal code.  (TRAP_TRACE is
currently used in FreeBSD for any DB# exception on x86 including a single
step trap or a watchpoint trigger.)

This fixed 27 previously failing tests in the testsuite for me on
FreeBSD/amd64.

John Baldwin (3):
  Implement "to_stopped_by_hw_breakpoint" for x86 debug registers.
  Add a new debug knob for the FreeBSD native target.
  Use signal information to determine SIGTRAP type for FreeBSD.

 gdb/ChangeLog       |  32 ++++++++++++
 gdb/NEWS            |   6 +++
 gdb/doc/ChangeLog   |   5 ++
 gdb/doc/gdb.texinfo |   5 ++
 gdb/fbsd-nat.c      | 139 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/nat/x86-dregs.c |  45 +++++++++++++++++
 gdb/nat/x86-dregs.h |   4 ++
 gdb/x86-nat.c       |  13 +++++
 8 files changed, 249 insertions(+)

-- 
2.15.1