This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
RFA: Small fix to valops.c (value_assign)
- To: gdb-patches at sourceware dot cygnus dot com
- Subject: RFA: Small fix to valops.c (value_assign)
- From: Fernando Nasser <fnasser at cygnus dot com>
- Date: Fri, 09 Jun 2000 00:57:07 +0000
- Organization: Cygnus Solutions (a Red Hat company) - Toronto
This causes some spurious register reads (sometimes to a invalid
register number) on some targets when reading fields of typed registers
that are not on the first byte of the register.
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@cygnus.com
Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.457
diff -c -p -r1.457 ChangeLog
*** ChangeLog 2000/06/09 00:51:54 1.457
--- ChangeLog 2000/06/09 00:54:04
***************
*** 1,5 ****
--- 1,10 ----
2000-06-08 Fernando Nasser <fnasser@cygnus.com>
+ * valops.c (value_assign): Adjust the length to take into
+ consideration that we are not starting from the beginning.
+
+ 2000-06-08 Fernando Nasser <fnasser@cygnus.com>
+
* values.c (value_primitive_field): Copy VALUE_REGNO as well.
With typed registers we may have the location information in this field,
in addition to VALUE_ADDRESS (which was already being copied).
Index: valops.c
===================================================================
RCS file: /cvs/src/src/gdb/valops.c,v
retrieving revision 1.16
diff -c -p -r1.16 valops.c
*** valops.c 2000/05/28 01:12:33 1.16
--- valops.c 2000/06/09 00:54:05
*************** value_assign (toval, fromval)
*** 660,666 ****
if (VALUE_BITSIZE (toval))
{
char buffer[sizeof (LONGEST)];
! int len = REGISTER_RAW_SIZE (VALUE_REGNO (toval));
if (len > (int) sizeof (LONGEST))
error ("Can't handle bitfields in registers larger than %d bits.",
--- 660,667 ----
if (VALUE_BITSIZE (toval))
{
char buffer[sizeof (LONGEST)];
! int len =
! REGISTER_RAW_SIZE (VALUE_REGNO (toval)) - VALUE_OFFSET (toval);
if (len > (int) sizeof (LONGEST))
error ("Can't handle bitfields in registers larger than %d bits.",