From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Taylor To: Fernando Nasser Cc: gdb-patches@sourceware.cygnus.com Subject: Re: RFA: Small fix to valops.c (value_assign) Date: Mon, 12 Jun 2000 07:15:00 -0000 Message-id: <200006121414.KAA01113@texas.cygnus.com> X-SW-Source: 2000-06/msg00137.html Date: Fri, 09 Jun 2000 00:57:07 +0000 From: Fernando Nasser 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. I assume that you mean that it *PREVENTS* some spurious register reads... -- 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 + * valops.c (value_assign): Adjust the length to take into + consideration that we are not starting from the beginning. + + 2000-06-08 Fernando Nasser + * 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). Approved. 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.",