/* Perform arithmetic and other operations on values, for GDB.
Copyright (C) 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
+ 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
Free Software Foundation, Inc.
This file is part of GDB.
memcpy (value_contents_writeable (v),
value_contents (array) + elt_offs, elt_size);
- if (VALUE_LVAL (array) == lval_internalvar)
- VALUE_LVAL (v) = lval_internalvar_component;
- else
- VALUE_LVAL (v) = VALUE_LVAL (array);
- VALUE_ADDRESS (v) = VALUE_ADDRESS (array);
+ set_value_component_location (v, array);
VALUE_REGNUM (v) = VALUE_REGNUM (array);
VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array);
set_value_offset (v, value_offset (array) + elt_offs);
set_value_bitpos (v, bit_index);
set_value_bitsize (v, 1);
-
- VALUE_LVAL (v) = VALUE_LVAL (bitstring);
- if (VALUE_LVAL (bitstring) == lval_internalvar)
- VALUE_LVAL (v) = lval_internalvar_component;
- VALUE_ADDRESS (v) = VALUE_ADDRESS (bitstring);
+ set_value_component_location (v, bitstring);
VALUE_FRAME_ID (v) = VALUE_FRAME_ID (bitstring);
set_value_offset (v, offset + value_offset (bitstring));
arg1 = coerce_ref (arg1);
arg2 = coerce_ref (arg2);
- arg1 = coerce_enum (arg1);
- arg2 = coerce_enum (arg2);
/* now we know that what we have to do is construct our
arg vector and find the right function to call it with. */
int static_memfuncp, nargs;
arg1 = coerce_ref (arg1);
- arg1 = coerce_enum (arg1);
/* now we know that what we have to do is construct our
arg vector and find the right function to call it with. */
break;
case UNOP_POSTINCREMENT:
strcpy (ptr, "++");
- argvec[2] = value_from_longest (builtin_type_int, 0);
+ argvec[2] = value_from_longest (builtin_type_int8, 0);
argvec[3] = 0;
nargs ++;
break;
case UNOP_POSTDECREMENT:
strcpy (ptr, "--");
- argvec[2] = value_from_longest (builtin_type_int, 0);
+ argvec[2] = value_from_longest (builtin_type_int8, 0);
argvec[3] = 0;
nargs ++;
break;
struct value *val;
struct type *type1, *type2, *result_type;
- /* For shift and integer exponentiation operations,
- only promote the first argument. */
- if ((op == BINOP_LSH || op == BINOP_RSH || op == BINOP_EXP)
- && is_integral_type (value_type (arg2)))
- unop_promote (current_language, current_gdbarch, &arg1);
- else
- binop_promote (current_language, current_gdbarch, &arg1, &arg2);
-
arg1 = coerce_ref (arg1);
arg2 = coerce_ref (arg2);
const gdb_byte *p;
struct type *type1;
- arg1 = coerce_number (arg1);
+ arg1 = coerce_array (arg1);
type1 = check_typedef (value_type (arg1));
if (TYPE_CODE (type1) == TYPE_CODE_FLT)
{
struct type *type;
- unop_promote (current_language, current_gdbarch, &arg1);
-
arg1 = coerce_ref (arg1);
type = check_typedef (value_type (arg1));
{
struct type *type;
- unop_promote (current_language, current_gdbarch, &arg1);
-
arg1 = coerce_ref (arg1);
type = check_typedef (value_type (arg1));
{
struct type *type;
- unop_promote (current_language, current_gdbarch, &arg1);
-
arg1 = coerce_ref (arg1);
type = check_typedef (value_type (arg1));
LONGEST low_bound, high_bound;
LONGEST word;
unsigned rel_index;
- struct type *range = TYPE_FIELD_TYPE (type, 0);
+ struct type *range = TYPE_INDEX_TYPE (type);
if (get_discrete_bounds (range, &low_bound, &high_bound) < 0)
return -2;
if (index < low_bound || index > high_bound)
return -1;
rel_index = index - low_bound;
- word = unpack_long (builtin_type_unsigned_char,
- valaddr + (rel_index / TARGET_CHAR_BIT));
+ word = extract_unsigned_integer (valaddr + (rel_index / TARGET_CHAR_BIT), 1);
rel_index %= TARGET_CHAR_BIT;
if (gdbarch_bits_big_endian (current_gdbarch))
rel_index = TARGET_CHAR_BIT - 1 - rel_index;