aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/arm-linux-nat.c12
2 files changed, 15 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 295ef34..273c6b3 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-17 Pedro Alves <palves@redhat.com>
+
+ * arm-linux-nat.c (arm_linux_can_use_hw_breakpoint): Return zero
+ if HW point of TYPE isn't supported.
+
2015-04-17 Yao Qi <yao.qi@linaro.org>
Pedro Alves <palves@redhat.com>
diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
index bb8358c..afc5817 100644
--- a/gdb/arm-linux-nat.c
+++ b/gdb/arm-linux-nat.c
@@ -771,12 +771,20 @@ arm_linux_can_use_hw_breakpoint (struct target_ops *self,
if (type == bp_hardware_watchpoint || type == bp_read_watchpoint
|| type == bp_access_watchpoint || type == bp_watchpoint)
{
- if (cnt + ot > arm_linux_get_hw_watchpoint_count ())
+ int count = arm_linux_get_hw_watchpoint_count ();
+
+ if (count == 0)
+ return 0;
+ else if (cnt + ot > count)
return -1;
}
else if (type == bp_hardware_breakpoint)
{
- if (cnt > arm_linux_get_hw_breakpoint_count ())
+ int count = arm_linux_get_hw_breakpoint_count ();
+
+ if (count == 0)
+ return 0;
+ else if (cnt > count)
return -1;
}
else