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

John Baldwin jhb@FreeBSD.org
Wed Feb 28 01:48:00 GMT 2018


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



More information about the Gdb-patches mailing list