[RFC PATCH 00/12] FreeBSD/aarch64 hardware watchpoint support

John Baldwin jhb@FreeBSD.org
Tue Mar 1 00:24:07 GMT 2022


The purpose of this series is to add support for aarch64 hardware
breakpoints and watchpoints on FreeBSD.

The first five patches are a detour to fix some small issues in the
x86 debug register support based on things I saw while porting the
aarch64 support over to FreeBSD.

Patches 6 and 7 work on splitting out platform-independent aarch64
debug register support from the Linux-specific aarch64 code.

Patch 6 has an open question about how best to handle having a
platform-specific hook for when debug registers have been changed.
Right now we require the platform to supply the function that
nat/aarch64-hw-point.c calls.  I did not choose to create an
equivalent to x86_dr_low, but perhaps that sort of structure, or at
least a function pointer should be used instead?

There is also some messiness around the Linux-specific
kernel_supports_any_contiguous_range workaround in patch 6.

One big concern is that while I have tested this on FreeBSD/amd64 and
FreeBSD/aarch64, I don't have a way to test this on Linux Aarch64.

John Baldwin (12):
  Remove USE_SIGTRAP_SIGINFO condition for FreeBSD/x86 debug regs
    support.
  x86-nat: Use an unordered_map to store per-pid debug reg state.
  x86-nat: Add x86_lookup_debug_reg_state.
  Add an x86_fbsd_nat_target mixin class for FreeBSD x86 native targets.
  fbsd-nat: Add a low_new_fork virtual method.
  x86-fbsd-nat: Copy debug register state on fork.
  nat: Split out platform-independent aarch64 debug register support.
  aarch64: Add an aarch64_nat_target mixin class.
  fbsd-nat: Add helper routine to fetch siginfo_t for a ptid.
  fbsd-nat: Add a low_delete_thread virtual method.
  fbsd-nat: Add a low_prepare_to_resume virtual method.
  Add support for hardware breakpoints/watchpoints on FreeBSD/Aarch64.

 gdb/NEWS                         |   2 +
 gdb/aarch64-fbsd-nat.c           | 260 ++++++++++++-
 gdb/aarch64-linux-nat.c          | 333 +---------------
 gdb/aarch64-nat.c                | 311 +++++++++++++++
 gdb/aarch64-nat.h                | 110 ++++++
 gdb/amd64-fbsd-nat.c             |  20 +-
 gdb/configure.nat                |  12 +-
 gdb/fbsd-nat.c                   |  28 +-
 gdb/fbsd-nat.h                   |  18 +
 gdb/i386-fbsd-nat.c              |  20 +-
 gdb/nat/aarch64-hw-point.c       | 625 +++++++++++++++++++++++++++++++
 gdb/nat/aarch64-hw-point.h       | 127 +++++++
 gdb/nat/aarch64-linux-hw-point.c | 605 +-----------------------------
 gdb/nat/aarch64-linux-hw-point.h | 105 +-----
 gdb/nat/aarch64-linux.c          |   4 +-
 gdb/x86-fbsd-nat.c               |  45 +++
 gdb/x86-fbsd-nat.h               |  36 ++
 gdb/x86-nat.c                    | 108 ++----
 gdb/x86-nat.h                    |   5 +
 gdbserver/linux-aarch64-low.cc   |  13 +-
 20 files changed, 1634 insertions(+), 1153 deletions(-)
 create mode 100644 gdb/aarch64-nat.c
 create mode 100644 gdb/aarch64-nat.h
 create mode 100644 gdb/nat/aarch64-hw-point.c
 create mode 100644 gdb/nat/aarch64-hw-point.h
 create mode 100644 gdb/x86-fbsd-nat.c
 create mode 100644 gdb/x86-fbsd-nat.h

-- 
2.34.1



More information about the Gdb-patches mailing list