Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdbserver aarch64 fix the clamping of HW break point and watchpoint counts.
@ 2013-02-07 15:51 Marcus Shawcroft
  2013-02-07 16:14 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Marcus Shawcroft @ 2013-02-07 15:51 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gdbserver-hwbp-clamping.diff --]
[-- Type: text/x-patch; name=0001-gdbserver-hwbp-clamping.diff, Size: 1539 bytes --]

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
     {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] gdbserver aarch64 fix the clamping of HW break point and watchpoint counts.
  2013-02-07 15:51 [PATCH] gdbserver aarch64 fix the clamping of HW break point and watchpoint counts Marcus Shawcroft
@ 2013-02-07 16:14 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2013-02-07 16:14 UTC (permalink / raw)
  To: Marcus Shawcroft; +Cc: gdb-patches

On 02/07/2013 03:51 PM, Marcus Shawcroft wrote:
> This issue came to light in the recent review of aarch64-linux-nat, and also needs resolving in GDBserver.
> 
> OK?

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.

Minor, minor nit: "Fix" is a "why" (which in general may end up wrong in
retrospect), while change log entries record the "what".  This would
be more in accordance:

        * 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.

Sorry for being pedant.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-07 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-07 15:51 [PATCH] gdbserver aarch64 fix the clamping of HW break point and watchpoint counts Marcus Shawcroft
2013-02-07 16:14 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox