This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] gdbserver aarch64 fix the clamping of HW break point and watchpoint counts.
- From: Marcus Shawcroft <marcus dot shawcroft at arm dot com>
- To: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Thu, 07 Feb 2013 15:51:25 +0000
- Subject: [PATCH] gdbserver aarch64 fix the clamping of HW break point and watchpoint counts.
This issue came to light in the recent review of aarch64-linux-nat, and
also needs resolving in GDBserver.
OK?
/Marcus
2013-02-07 Marcus Shawcroft <marcus.shawcroft@arm.com>
* linux-aarch64-low.c (aarch64_arch_setup): Fix clamping of
aarch64_num_wp_regs and aarch64_num_bp_regs.
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index e56ea80..3bd9af8 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -1202,10 +1202,13 @@ aarch64_arch_setup (void)
&& AARCH64_DEBUG_ARCH (dreg_state.dbg_info) == AARCH64_DEBUG_ARCH_V8)
{
aarch64_num_wp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
- if (aarch64_num_wp_regs > AARCH64_HBP_MAX_NUM)
- warning ("Unexpected number of hardware watchpoint registers reported"
- " by ptrace, got %d, expected %d.",
- aarch64_num_wp_regs, AARCH64_HBP_MAX_NUM);
+ if (aarch64_num_wp_regs > AARCH64_HWP_MAX_NUM)
+ {
+ warning ("Unexpected number of hardware watchpoint registers reported"
+ " by ptrace, got %d, expected %d.",
+ aarch64_num_wp_regs, AARCH64_HWP_MAX_NUM);
+ aarch64_num_wp_regs = AARCH64_HWP_MAX_NUM;
+ }
}
else
{
@@ -1220,9 +1223,12 @@ aarch64_arch_setup (void)
{
aarch64_num_bp_regs = AARCH64_DEBUG_NUM_SLOTS (dreg_state.dbg_info);
if (aarch64_num_bp_regs > AARCH64_HBP_MAX_NUM)
- warning ("Unexpected number of hardware breakpoint registers reported"
- " by ptrace, got %d, expected %d.",
- aarch64_num_bp_regs, AARCH64_HBP_MAX_NUM);
+ {
+ warning ("Unexpected number of hardware breakpoint registers reported"
+ " by ptrace, got %d, expected %d.",
+ aarch64_num_bp_regs, AARCH64_HBP_MAX_NUM);
+ aarch64_num_bp_regs = AARCH64_HBP_MAX_NUM;
+ }
}
else
{