Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] target.c: eliminate one use of DEPRECATED_REGISTER_SIZE
@ 2004-01-09  3:20 Kevin Buettner
  2004-01-11 19:15 ` Andrew Cagney
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2004-01-09  3:20 UTC (permalink / raw)
  To: gdb-patches

On FR-V, we found that hardware watchpoints were no longer working. 
The reason for this is that frv-tdep.c was changed a while back to no
longer define DEPRECATED_REGISTER_SIZE.  As a consequence,
DEPRECATED_REGISTER_SIZE is always 0.  This means that the expression

    (byte_count <= DEPRECATED_REGISTER_SIZE)

always evaluates to false, which effectively (though unintentionally) means
that no memory region is ever suitable for hardware watchpoints.

The use of the register's size (width in bytes) in this expression was
dubious to begin with.  It seems to me that using the size of a
pointer makes (somewhat) more sense.

Okay?

	* target.c (default_region_size_ok_for_hw_watchpoint): Compare
	the region size against the size of a pointer, not the size of
	a register as given by DEPRECATED_REGISTER_SIZE.

Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.68
diff -u -p -r1.68 target.c
--- target.c	5 Jan 2004 22:32:23 -0000	1.68
+++ target.c	9 Jan 2004 03:01:23 -0000
@@ -1362,7 +1362,7 @@ find_default_create_inferior (char *exec
 static int
 default_region_size_ok_for_hw_watchpoint (int byte_count)
 {
-  return (byte_count <= DEPRECATED_REGISTER_SIZE);
+  return (byte_count <= (TARGET_PTR_BIT / TARGET_CHAR_BIT));
 }
 
 static int


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

* Re: [RFA] target.c: eliminate one use of DEPRECATED_REGISTER_SIZE
  2004-01-09  3:20 [RFA] target.c: eliminate one use of DEPRECATED_REGISTER_SIZE Kevin Buettner
@ 2004-01-11 19:15 ` Andrew Cagney
  2004-01-19 16:52   ` Kevin Buettner
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2004-01-11 19:15 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

>  default_region_size_ok_for_hw_watchpoint (int byte_count)
>  {
> -  return (byte_count <= DEPRECATED_REGISTER_SIZE);
> +  return (byte_count <= (TARGET_PTR_BIT / TARGET_CHAR_BIT));
>  }
>  
Ok, but with `TYPE_LENGTH (builtin_type_void_{code/data}_ptr)'.  Here I 
believe that the data pointer would be more correct.

Andrew



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

* Re: [RFA] target.c: eliminate one use of DEPRECATED_REGISTER_SIZE
  2004-01-11 19:15 ` Andrew Cagney
@ 2004-01-19 16:52   ` Kevin Buettner
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Buettner @ 2004-01-19 16:52 UTC (permalink / raw)
  To: gdb-patches

On Sun, 11 Jan 2004 14:15:08 -0500
Andrew Cagney <cagney@gnu.org> wrote:

> >  default_region_size_ok_for_hw_watchpoint (int byte_count)
> >  {
> > -  return (byte_count <= DEPRECATED_REGISTER_SIZE);
> > +  return (byte_count <= (TARGET_PTR_BIT / TARGET_CHAR_BIT));
> >  }
> >  
> Ok, but with `TYPE_LENGTH (builtin_type_void_{code/data}_ptr)'.  Here I 
> believe that the data pointer would be more correct.

Okay.

Committed.  Here's what went in:

	* target.c (default_region_size_ok_for_hw_watchpoint): Compare
	the region size against the size of a pointer, not the size of
	a register as given by DEPRECATED_REGISTER_SIZE.

Index: target.c
===================================================================
RCS file: /cvs/src/src/gdb/target.c,v
retrieving revision 1.69
diff -u -p -r1.69 target.c
--- target.c	19 Jan 2004 01:20:11 -0000	1.69
+++ target.c	19 Jan 2004 16:45:48 -0000
@@ -1360,7 +1360,7 @@ find_default_create_inferior (char *exec
 static int
 default_region_size_ok_for_hw_watchpoint (int byte_count)
 {
-  return (byte_count <= DEPRECATED_REGISTER_SIZE);
+  return (byte_count <= TYPE_LENGTH (builtin_type_void_data_ptr));
 }
 
 static int


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

end of thread, other threads:[~2004-01-19 16:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-09  3:20 [RFA] target.c: eliminate one use of DEPRECATED_REGISTER_SIZE Kevin Buettner
2004-01-11 19:15 ` Andrew Cagney
2004-01-19 16:52   ` Kevin Buettner

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