2013-02-07 Marcus Shawcroft <marcus.shawcroft@arm.com>
authorMarcus Shawcroft <mshawcroft@sourceware.org>
Thu, 7 Feb 2013 17:32:29 +0000 (17:32 +0000)
committerMarcus Shawcroft <mshawcroft@sourceware.org>
Thu, 7 Feb 2013 17:32:29 +0000 (17:32 +0000)
        * linux-aarch64-low.c (aarch64_arch_setup): Clamp
        aarch64_num_wp_regs and aarch64_num_bp_regs to
        AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-aarch64-low.c

index f26620baffaa2d7547aafdf675f76ba87e0256df..f2d41d821f1c3fa0005a92d9502376ab5ceda180 100644 (file)
@@ -1,3 +1,9 @@
+2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
+
+       * linux-aarch64-low.c (aarch64_arch_setup): Clamp
+       aarch64_num_wp_regs and aarch64_num_bp_regs to
+       AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
+
 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
 
        * linux-aarch64-low.c (ps_get_thread_area): Replace
index 883277c3a4043e568732021da7e702def9af26eb..9dcfc55faa4c1ebb9a9ce1ee2bf7a7b1bd8e913f 100644 (file)
@@ -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
     {