[RFA] target.c: eliminate one use of DEPRECATED_REGISTER_SIZE
Kevin Buettner
kevinb@redhat.com
Fri Jan 9 03:20:00 GMT 2004
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
More information about the Gdb-patches
mailing list