2005-02-06 Andrew Cagney <cagney@gnu.org>
* value.c (value_contents, value_contents_writeable): New functions. * value.h (VALUE_CONTENTS): Delete macro. (value_contents, value_contents_writeable): Declare. * xstormy16-tdep.c, value.c, valops.c, valarith.c: Update. * stack.c, sparc-tdep.c, sparc64-tdep.c, sh-tdep.c: Update. * sh64-tdep.c, scm-valprint.c, scm-exp.c, s390-tdep.c: Update. * rs6000-tdep.c, p-valprint.c, printcmd.c: Update. * ppc-sysv-tdep.c, mips-tdep.c, mi/mi-main.c: Update. * m88k-tdep.c, m68hc11-tdep.c, m32r-tdep.c: Update. * jv-valprint.c, ia64-tdep.c, hppa-tdep.c: Update. * hpacc-abi.c, f-valprint.c, frv-tdep.c, eval.c: Update. * c-valprint.c, cris-tdep.c, cp-valprint.c: Update. * cli/cli-dump.c, breakpoint.c, avr-tdep.c, arm-tdep.c: Update. * arm-linux-tdep.c, amd64-tdep.c, alpha-tdep.c: Update. * ada-valprint.c, ada-lang.c: Update.
This commit is contained in:
parent
1b3a857543
commit
0fd88904d9
43 changed files with 273 additions and 229 deletions
16
gdb/eval.c
16
gdb/eval.c
|
@ -209,7 +209,7 @@ evaluate_struct_tuple (struct value *struct_val,
|
|||
struct value *val = NULL;
|
||||
int nlabels = 0;
|
||||
int bitpos, bitsize;
|
||||
char *addr;
|
||||
bfd_byte *addr;
|
||||
|
||||
/* Skip past the labels, and count them. */
|
||||
while (get_label (exp, pos) != NULL)
|
||||
|
@ -315,12 +315,12 @@ evaluate_struct_tuple (struct value *struct_val,
|
|||
bitpos = TYPE_FIELD_BITPOS (struct_type, fieldno);
|
||||
if (variantno >= 0)
|
||||
bitpos += TYPE_FIELD_BITPOS (substruct_type, subfieldno);
|
||||
addr = VALUE_CONTENTS (struct_val) + bitpos / 8;
|
||||
addr = value_contents_writeable (struct_val) + bitpos / 8;
|
||||
if (bitsize)
|
||||
modify_field (addr, value_as_long (val),
|
||||
bitpos % 8, bitsize);
|
||||
else
|
||||
memcpy (addr, VALUE_CONTENTS (val),
|
||||
memcpy (addr, value_contents (val),
|
||||
TYPE_LENGTH (value_type (val)));
|
||||
}
|
||||
while (--nlabels > 0);
|
||||
|
@ -362,7 +362,7 @@ init_array_element (struct value *array, struct value *element,
|
|||
{
|
||||
memcpy (value_contents_raw (array)
|
||||
+ (index - low_bound) * element_size,
|
||||
VALUE_CONTENTS (element), element_size);
|
||||
value_contents (element), element_size);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -371,7 +371,7 @@ init_array_element (struct value *array, struct value *element,
|
|||
if (index < low_bound || index > high_bound)
|
||||
error ("tuple index out of range");
|
||||
memcpy (value_contents_raw (array) + (index - low_bound) * element_size,
|
||||
VALUE_CONTENTS (element), element_size);
|
||||
value_contents (element), element_size);
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
@ -546,7 +546,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
error ("Too many array elements");
|
||||
memcpy (value_contents_raw (array)
|
||||
+ (index - low_bound) * element_size,
|
||||
VALUE_CONTENTS (element),
|
||||
value_contents (element),
|
||||
element_size);
|
||||
}
|
||||
index++;
|
||||
|
@ -1442,7 +1442,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
if ((TYPE_CODE (value_type (arg1)) == TYPE_CODE_PTR) &&
|
||||
(TYPE_CODE (TYPE_TARGET_TYPE (value_type (arg1))) == TYPE_CODE_MEMBER))
|
||||
{
|
||||
unsigned int *ptr = (unsigned int *) VALUE_CONTENTS (arg2); /* forces evaluation */
|
||||
unsigned int *ptr = (unsigned int *) value_contents (arg2); /* forces evaluation */
|
||||
*ptr |= 0x20000000; /* set 29th bit */
|
||||
}
|
||||
}
|
||||
|
@ -1939,7 +1939,7 @@ evaluate_subexp_standard (struct type *expect_type,
|
|||
(TYPE_CODE (value_type (retvalp)) == TYPE_CODE_PTR) &&
|
||||
(TYPE_CODE (TYPE_TARGET_TYPE (value_type (retvalp))) == TYPE_CODE_MEMBER))
|
||||
{
|
||||
unsigned int *ptr = (unsigned int *) VALUE_CONTENTS (retvalp); /* forces evaluation */
|
||||
unsigned int *ptr = (unsigned int *) value_contents (retvalp); /* forces evaluation */
|
||||
*ptr |= 0x20000000; /* set 29th bit */
|
||||
}
|
||||
return retvalp;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue