diff options
author | John Baldwin <jhb@FreeBSD.org> | 2022-03-22 12:05:43 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2022-03-22 12:05:43 -0700 |
commit | 4bd817e71eefd659f51ec75bfb13109c486e8311 (patch) | |
tree | d7a767fcc3fff651237b5c29eea74588cb3c1ad8 /gdb/aarch64-linux-nat.c | |
parent | 041a4212d37de6172b3428613c9f9f52ab950c6c (diff) | |
download | gdb-4bd817e71eefd659f51ec75bfb13109c486e8311.zip gdb-4bd817e71eefd659f51ec75bfb13109c486e8311.tar.gz gdb-4bd817e71eefd659f51ec75bfb13109c486e8311.tar.bz2 |
nat: Split out platform-independent aarch64 debug register support.
Move non-Linux-specific support for hardware break/watchpoints from
nat/aarch64-linux-hw-point.c to nat/aarch64-hw-point.c. Changes
beyond a simple split of the code are:
- aarch64_linux_region_ok_for_watchpoint and
aarch64_linux_any_set_debug_regs_state renamed to drop linux_ as
they are not platform specific.
- Platforms must implement the aarch64_notify_debug_reg_change
function which is invoked from the platform-independent code when a
debug register changes for a given debug register state. This does
not use the indirection of a 'low' structure as is done for x86.
- The handling for kernel_supports_any_contiguous_range is not
pristine. For non-Linux it is simply defined to true. Some uses of
this could perhaps be implemented as new 'low' routines for the
various places that check it instead?
- Pass down ptid into aarch64_handle_breakpoint and
aarch64_handle_watchpoint rather than using current_lwp_ptid which
is only defined on Linux. In addition, pass the ptid on to
aarch64_notify_debug_reg_change instead of the unused state
argument.
Diffstat (limited to 'gdb/aarch64-linux-nat.c')
-rw-r--r-- | gdb/aarch64-linux-nat.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index db76497..dd072d9 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -834,7 +834,8 @@ aarch64_linux_nat_target::insert_hw_breakpoint (struct gdbarch *gdbarch, "insert_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n", (unsigned long) addr, len); - ret = aarch64_handle_breakpoint (type, addr, len, 1 /* is_insert */, state); + ret = aarch64_handle_breakpoint (type, addr, len, 1 /* is_insert */, + inferior_ptid, state); if (show_debug_regs) { @@ -866,7 +867,8 @@ aarch64_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch, (gdb_stdlog, "remove_hw_breakpoint on entry (addr=0x%08lx, len=%d))\n", (unsigned long) addr, len); - ret = aarch64_handle_breakpoint (type, addr, len, 0 /* is_insert */, state); + ret = aarch64_handle_breakpoint (type, addr, len, 0 /* is_insert */, + inferior_ptid, state); if (show_debug_regs) { @@ -899,7 +901,8 @@ aarch64_linux_nat_target::insert_watchpoint (CORE_ADDR addr, int len, gdb_assert (type != hw_execute); - ret = aarch64_handle_watchpoint (type, addr, len, 1 /* is_insert */, state); + ret = aarch64_handle_watchpoint (type, addr, len, 1 /* is_insert */, + inferior_ptid, state); if (show_debug_regs) { @@ -931,7 +934,8 @@ aarch64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len, gdb_assert (type != hw_execute); - ret = aarch64_handle_watchpoint (type, addr, len, 0 /* is_insert */, state); + ret = aarch64_handle_watchpoint (type, addr, len, 0 /* is_insert */, + inferior_ptid, state); if (show_debug_regs) { @@ -947,7 +951,7 @@ aarch64_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len, int aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) { - return aarch64_linux_region_ok_for_watchpoint (addr, len); + return aarch64_region_ok_for_watchpoint (addr, len); } /* Implement the "stopped_data_address" target_ops method. */ |