gdb: remove some unnecessary watchpoint_addr_within_range overrides

While looking at the watchpoint code, I realised that AArch64, ARM,
and Loongarch all override watchpoint_addr_within_range with an
implementation that is the same as the default (but with the logic
written slightly differently).

Compare the deleted functions to default_watchpoint_addr_within_range
in target.c.

The only other targets that override watchpoint_addr_within_range are
ppc_linux_nat_target and remote_target, in both cases the
implementation is different to the default.

Lets remove these unnecessary overrides, and just use the default.

There should be no user visible changes after this commit.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Andrew Burgess
2025-08-18 11:49:21 +01:00
parent 17e62fe5f7
commit 4f68e8167e
3 changed files with 0 additions and 25 deletions

View File

@@ -92,10 +92,6 @@ struct aarch64_nat_target : public BaseTarget
int remove_hw_breakpoint (struct gdbarch *gdbarch,
struct bp_target_info *bp_tgt) override
{ return aarch64_remove_hw_breakpoint (gdbarch, bp_tgt); }
bool watchpoint_addr_within_range (CORE_ADDR addr, CORE_ADDR start,
int length) override
{ return start <= addr && start + length - 1 >= addr; }
};
#endif /* GDB_AARCH64_NAT_H */

View File

@@ -90,8 +90,6 @@ public:
bool stopped_data_address (CORE_ADDR *) override;
bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
const struct target_desc *read_description () override;
/* Override linux_nat_target low methods. */
@@ -1206,14 +1204,6 @@ arm_linux_nat_target::stopped_by_watchpoint ()
return stopped_data_address (&addr);
}
bool
arm_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr,
CORE_ADDR start,
int length)
{
return start <= addr && start + length - 1 >= addr;
}
/* Handle thread creation. We need to copy the breakpoints and watchpoints
in the parent thread to the child thread. */
void

View File

@@ -72,8 +72,6 @@ public:
struct expression *cond) override;
int remove_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type,
struct expression *cond) override;
bool watchpoint_addr_within_range (CORE_ADDR addr, CORE_ADDR start,
int length) override;
/* Add our hardware breakpoint and watchpoint implementation. */
bool stopped_by_watchpoint () override;
@@ -581,15 +579,6 @@ loongarch_linux_nat_target::remove_watchpoint (CORE_ADDR addr, int len,
}
bool
loongarch_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr,
CORE_ADDR start,
int length)
{
return start <= addr && start + length - 1 >= addr;
}
/* Implement the "stopped_data_address" target_ops method. */
bool