This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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;
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]