This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] Fix checks in register_size()
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Wed, 09 Jul 2003 10:36:20 -0400
- Subject: [commit] Fix checks in register_size()
Just FYI,
This fixes the check in register_size, at the same time adding a few
extra comments.
committed,
Andrew
2003-07-09 Andrew Cagney <cagney@redhat.com>
* regcache.c (register_size): Only check REGISTER_RAW_SIZE once.
Add comments about the checks.
Index: regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.89
diff -u -r1.89 regcache.c
--- regcache.c 3 Jul 2003 14:34:29 -0000 1.89
+++ regcache.c 9 Jul 2003 14:34:09 -0000
@@ -290,8 +290,11 @@
int size;
gdb_assert (regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS));
size = descr->sizeof_register[regnum];
+ /* NB: The deprecated REGISTER_RAW_SIZE, if not provided, defaults
+ to the size of the register's type. */
gdb_assert (size == REGISTER_RAW_SIZE (regnum)); /* OK */
- gdb_assert (size == REGISTER_RAW_SIZE (regnum)); /* OK */
+ /* NB: Don't check the register's virtual size. It, in say the case
+ of the MIPS, may not match the raw size! */
return size;
}