mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 23:23:09 +00:00
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:
@@ -92,10 +92,6 @@ struct aarch64_nat_target : public BaseTarget
|
|||||||
int remove_hw_breakpoint (struct gdbarch *gdbarch,
|
int remove_hw_breakpoint (struct gdbarch *gdbarch,
|
||||||
struct bp_target_info *bp_tgt) override
|
struct bp_target_info *bp_tgt) override
|
||||||
{ return aarch64_remove_hw_breakpoint (gdbarch, bp_tgt); }
|
{ 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 */
|
#endif /* GDB_AARCH64_NAT_H */
|
||||||
|
|||||||
@@ -90,8 +90,6 @@ public:
|
|||||||
|
|
||||||
bool stopped_data_address (CORE_ADDR *) override;
|
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;
|
const struct target_desc *read_description () override;
|
||||||
|
|
||||||
/* Override linux_nat_target low methods. */
|
/* Override linux_nat_target low methods. */
|
||||||
@@ -1206,14 +1204,6 @@ arm_linux_nat_target::stopped_by_watchpoint ()
|
|||||||
return stopped_data_address (&addr);
|
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
|
/* Handle thread creation. We need to copy the breakpoints and watchpoints
|
||||||
in the parent thread to the child thread. */
|
in the parent thread to the child thread. */
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -72,8 +72,6 @@ public:
|
|||||||
struct expression *cond) override;
|
struct expression *cond) override;
|
||||||
int remove_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type,
|
int remove_watchpoint (CORE_ADDR addr, int len, enum target_hw_bp_type type,
|
||||||
struct expression *cond) override;
|
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. */
|
/* Add our hardware breakpoint and watchpoint implementation. */
|
||||||
bool stopped_by_watchpoint () override;
|
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. */
|
/* Implement the "stopped_data_address" target_ops method. */
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|||||||
Reference in New Issue
Block a user