+2002-01-03 Andrew Cagney <ac131313@redhat.com>
+
+ * valarith.c: Replace value_ptr with struct value pointer. Remove
+ register attribute from value declarations.
+ * valops.c: Ditto.
+ * value.h: Ditto.
+ * scm-lang.c (scm_lookup_name): Ditto.
+
2002-01-01 Mark Kettenis <kettenis@gnu.org>
* i386-tdep.h (struct gdbarch_tdep): Add `os_ident' member.
+2002-01-03 Andrew Cagney <ac131313@redhat.com>
+
+ * gdbint.texinfo (Target Architecture Definition): Replace
+ value_ptr with struct value pointer.
+
2002-01-02 Eli Zaretskii <eliz@gnu.org>
* gdb.texinfo (Free Software): Fix wording.
@ifinfo
This file documents the internals of the GNU debugger @value{GDBN}.
-Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001
+Copyright 1990,1991,1992,1993,1994,1996,1998,1999,2000,2001,2002
Free Software Foundation, Inc.
Contributed by Cygnus Solutions. Written by John Gilmore.
Second Edition by Stan Shebs.
will signal an internal error.
@end deftypefun
-@deftypefun CORE_ADDR value_as_address (value_ptr @var{val})
+@deftypefun CORE_ADDR value_as_address (struct value *@var{val})
Assuming that @var{val} is a pointer, return the address it represents,
as appropriate for the current architecture.
/* Scheme/Guile language support routines for GDB, the GNU debugger.
- Copyright 1995, 1996, 1998, 2000, 2001
+ Copyright 1995, 1996, 1998, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
static struct value *
scm_lookup_name (char *str)
{
- value_ptr args[3];
+ struct value *args[3];
int len = strlen (str);
struct value *func;
struct value *val;
/* Perform arithmetic and other operations on values, for GDB.
- Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
- 1997, 1998, 1999, 2000
+ Copyright 1986, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+ 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
#define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2)
#endif
-static value_ptr value_subscripted_rvalue (value_ptr, value_ptr, int);
+static struct value *value_subscripted_rvalue (struct value *, struct value *, int);
void _initialize_valarith (void);
\f
-value_ptr
-value_add (value_ptr arg1, value_ptr arg2)
+struct value *
+value_add (struct value *arg1, struct value *arg2)
{
- register value_ptr valint, valptr;
+ struct value *valint;
+ struct value *valptr;
register int len;
struct type *type1, *type2, *valptrtype;
|| TYPE_CODE (type2) == TYPE_CODE_INT))
/* Exactly one argument is a pointer, and one is an integer. */
{
- value_ptr retval;
+ struct value *retval;
if (TYPE_CODE (type1) == TYPE_CODE_PTR)
{
return value_binop (arg1, arg2, BINOP_ADD);
}
-value_ptr
-value_sub (value_ptr arg1, value_ptr arg2)
+struct value *
+value_sub (struct value *arg1, struct value *arg2)
{
struct type *type1, *type2;
COERCE_NUMBER (arg1);
FIXME: Perhaps we should validate that the index is valid and if
verbosity is set, warn about invalid indices (but still use them). */
-value_ptr
-value_subscript (value_ptr array, value_ptr idx)
+struct value *
+value_subscript (struct value *array, struct value *idx)
{
- value_ptr bound;
+ struct value *bound;
int c_style = current_language->c_style_arrays;
struct type *tarray;
{
struct type *range_type = TYPE_INDEX_TYPE (tarray);
LONGEST index = value_as_long (idx);
- value_ptr v;
+ struct value *v;
int offset, byte, bit_index;
LONGEST lowerbound, upperbound;
get_discrete_bounds (range_type, &lowerbound, &upperbound);
(eg, a vector register). This routine used to promote floats
to doubles, but no longer does. */
-static value_ptr
-value_subscripted_rvalue (value_ptr array, value_ptr idx, int lowerbound)
+static struct value *
+value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound)
{
struct type *array_type = check_typedef (VALUE_TYPE (array));
struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
unsigned int elt_size = TYPE_LENGTH (elt_type);
LONGEST index = value_as_long (idx);
unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
- value_ptr v;
+ struct value *v;
if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
error ("no such vector element");
For now, we do not overload the `=' operator. */
int
-binop_user_defined_p (enum exp_opcode op, value_ptr arg1, value_ptr arg2)
+binop_user_defined_p (enum exp_opcode op, struct value *arg1, struct value *arg2)
{
struct type *type1, *type2;
if (op == BINOP_ASSIGN || op == BINOP_CONCAT)
For now, we do not overload the `&' operator. */
int
-unop_user_defined_p (enum exp_opcode op, value_ptr arg1)
+unop_user_defined_p (enum exp_opcode op, struct value *arg1)
{
struct type *type1;
if (op == UNOP_ADDR)
is the opcode saying how to modify it. Otherwise, OTHEROP is
unused. */
-value_ptr
-value_x_binop (value_ptr arg1, value_ptr arg2, enum exp_opcode op,
+struct value *
+value_x_binop (struct value *arg1, struct value *arg2, enum exp_opcode op,
enum exp_opcode otherop, enum noside noside)
{
- value_ptr *argvec;
+ struct value **argvec;
char *ptr;
char tstr[13];
int static_memfuncp;
if (TYPE_CODE (check_typedef (VALUE_TYPE (arg1))) != TYPE_CODE_STRUCT)
error ("Can't do that binary op on that type"); /* FIXME be explicit */
- argvec = (value_ptr *) alloca (sizeof (value_ptr) * 4);
+ argvec = (struct value **) alloca (sizeof (struct value *) * 4);
argvec[1] = value_addr (arg1);
argvec[2] = arg2;
argvec[3] = 0;
and return that value (where '@' is (almost) any unary operator which
is legal for GNU C++). */
-value_ptr
-value_x_unop (value_ptr arg1, enum exp_opcode op, enum noside noside)
+struct value *
+value_x_unop (struct value *arg1, enum exp_opcode op, enum noside noside)
{
- value_ptr *argvec;
+ struct value **argvec;
char *ptr, *mangle_ptr;
char tstr[13], mangle_tstr[13];
int static_memfuncp;
if (TYPE_CODE (check_typedef (VALUE_TYPE (arg1))) != TYPE_CODE_STRUCT)
error ("Can't do that unary op on that type"); /* FIXME be explicit */
- argvec = (value_ptr *) alloca (sizeof (value_ptr) * 3);
+ argvec = (struct value **) alloca (sizeof (struct value *) * 3);
argvec[1] = value_addr (arg1);
argvec[2] = 0;
string values of length 1.
*/
-value_ptr
-value_concat (value_ptr arg1, value_ptr arg2)
+struct value *
+value_concat (struct value *arg1, struct value *arg2)
{
- register value_ptr inval1, inval2, outval = NULL;
+ struct value *inval1;
+ struct value *inval2;
+ struct value *outval = NULL;
int inval1len, inval2len;
int count, idx;
char *ptr;
Does not support addition and subtraction on pointers;
use value_add or value_sub if you want to handle those possibilities. */
-value_ptr
-value_binop (value_ptr arg1, value_ptr arg2, enum exp_opcode op)
+struct value *
+value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op)
{
- register value_ptr val;
+ struct value *val;
struct type *type1, *type2;
COERCE_REF (arg1);
/* Simulate the C operator ! -- return 1 if ARG1 contains zero. */
int
-value_logical_not (value_ptr arg1)
+value_logical_not (struct value *arg1)
{
register int len;
register char *p;
necessarily null terminated) based on their length */
static int
-value_strcmp (register value_ptr arg1, register value_ptr arg2)
+value_strcmp (struct value *arg1, struct value *arg2)
{
int len1 = TYPE_LENGTH (VALUE_TYPE (arg1));
int len2 = TYPE_LENGTH (VALUE_TYPE (arg2));
iff ARG1 and ARG2 have equal contents. */
int
-value_equal (register value_ptr arg1, register value_ptr arg2)
+value_equal (struct value *arg1, struct value *arg2)
{
register int len;
register char *p1, *p2;
iff ARG1's contents are less than ARG2's. */
int
-value_less (register value_ptr arg1, register value_ptr arg2)
+value_less (struct value *arg1, struct value *arg2)
{
register enum type_code code1;
register enum type_code code2;
\f
/* The unary operators - and ~. Both free the argument ARG1. */
-value_ptr
-value_neg (register value_ptr arg1)
+struct value *
+value_neg (struct value *arg1)
{
register struct type *type;
register struct type *result_type = VALUE_TYPE (arg1);
}
}
-value_ptr
-value_complement (register value_ptr arg1)
+struct value *
+value_complement (struct value *arg1)
{
register struct type *type;
register struct type *result_type = VALUE_TYPE (arg1);
return (word >> rel_index) & 1;
}
-value_ptr
-value_in (value_ptr element, value_ptr set)
+struct value *
+value_in (struct value *element, struct value *set)
{
int member;
struct type *settype = check_typedef (VALUE_TYPE (set));
/* Perform non-arithmetic operations on values, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ Free Software Foundation, Inc.
This file is part of GDB.
extern int overload_debug;
/* Local functions. */
-static int typecmp (int staticp, struct type *t1[], value_ptr t2[]);
+static int typecmp (int staticp, struct type *t1[], struct value *t2[]);
-static CORE_ADDR find_function_addr (value_ptr, struct type **);
-static value_ptr value_arg_coerce (value_ptr, struct type *, int);
+static CORE_ADDR find_function_addr (struct value *, struct type **);
+static struct value *value_arg_coerce (struct value *, struct type *, int);
-static CORE_ADDR value_push (CORE_ADDR, value_ptr);
+static CORE_ADDR value_push (CORE_ADDR, struct value *);
-static value_ptr search_struct_field (char *, value_ptr, int,
+static struct value *search_struct_field (char *, struct value *, int,
struct type *, int);
-static value_ptr search_struct_method (char *, value_ptr *,
- value_ptr *,
+static struct value *search_struct_method (char *, struct value **,
+ struct value **,
int, int *, struct type *);
static int check_field_in (struct type *, const char *);
static CORE_ADDR allocate_space_in_inferior (int);
-static value_ptr cast_into_complex (struct type *, value_ptr);
+static struct value *cast_into_complex (struct type *, struct value *);
-static struct fn_field *find_method_list (value_ptr * argp, char *method,
+static struct fn_field *find_method_list (struct value ** argp, char *method,
int offset, int *static_memfuncp,
struct type *type, int *num_fns,
struct type **basetype,
/* Find the address of function name NAME in the inferior. */
-value_ptr
+struct value *
find_function_in_inferior (char *name)
{
register struct symbol *sym;
/* Allocate NBYTES of space in the inferior using the inferior's malloc
and return a value that is a pointer to the allocated space. */
-value_ptr
+struct value *
value_allocate_space_in_inferior (int len)
{
- value_ptr blocklen;
- register value_ptr val = find_function_in_inferior ("malloc");
+ struct value *blocklen;
+ struct value *val = find_function_in_inferior ("malloc");
blocklen = value_from_longest (builtin_type_int, (LONGEST) len);
val = call_function_by_hand (val, 1, &blocklen);
and if ARG2 is an lvalue it can be cast into anything at all. */
/* In C++, casts may change pointer or object representations. */
-value_ptr
-value_cast (struct type *type, register value_ptr arg2)
+struct value *
+value_cast (struct type *type, struct value *arg2)
{
register enum type_code code1;
register enum type_code code2;
/* Look in the type of the source to see if it contains the
type of the target as a superclass. If so, we'll need to
offset the object in addition to changing its type. */
- value_ptr v = search_struct_field (type_name_no_tag (type),
+ struct value *v = search_struct_field (type_name_no_tag (type),
arg2, 0, type2, 1);
if (v)
{
(code2 == TYPE_CODE_PTR))
{
unsigned int *ptr;
- value_ptr retvalp;
+ struct value *retvalp;
switch (TYPE_CODE (TYPE_TARGET_TYPE (type2)))
{
&& TYPE_CODE (t2) == TYPE_CODE_STRUCT
&& !value_logical_not (arg2))
{
- value_ptr v;
+ struct value *v;
/* Look in the type of the source to see if it contains the
type of the target as a superclass. If so, we'll need to
value_zero (t1, not_lval), 0, t1, 1);
if (v)
{
- value_ptr v2 = value_ind (arg2);
+ struct value *v2 = value_ind (arg2);
VALUE_ADDRESS (v2) -= VALUE_ADDRESS (v)
+ VALUE_OFFSET (v);
else if (chill_varying_type (type))
{
struct type *range1, *range2, *eltype1, *eltype2;
- value_ptr val;
+ struct value *val;
int count1, count2;
LONGEST low_bound, high_bound;
char *valaddr, *valaddr_data;
/* Create a value of type TYPE that is zero, and return it. */
-value_ptr
+struct value *
value_zero (struct type *type, enum lval_type lv)
{
- register value_ptr val = allocate_value (type);
+ struct value *val = allocate_value (type);
memset (VALUE_CONTENTS (val), 0, TYPE_LENGTH (check_typedef (type)));
VALUE_LVAL (val) = lv;
Note: value_at does *NOT* handle embedded offsets; perform such
adjustments before or after calling it. */
-value_ptr
+struct value *
value_at (struct type *type, CORE_ADDR addr, asection *sect)
{
- register value_ptr val;
+ struct value *val;
if (TYPE_CODE (check_typedef (type)) == TYPE_CODE_VOID)
error ("Attempt to dereference a generic pointer.");
/* Return a lazy value with type TYPE located at ADDR (cf. value_at). */
-value_ptr
+struct value *
value_at_lazy (struct type *type, CORE_ADDR addr, asection *sect)
{
- register value_ptr val;
+ struct value *val;
if (TYPE_CODE (check_typedef (type)) == TYPE_CODE_VOID)
error ("Attempt to dereference a generic pointer.");
value is ignored. */
int
-value_fetch_lazy (register value_ptr val)
+value_fetch_lazy (struct value *val)
{
CORE_ADDR addr = VALUE_ADDRESS (val) + VALUE_OFFSET (val);
int length = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val));
/* Store the contents of FROMVAL into the location of TOVAL.
Return a new value with the location of TOVAL and contents of FROMVAL. */
-value_ptr
-value_assign (register value_ptr toval, register value_ptr fromval)
+struct value *
+value_assign (struct value *toval, struct value *fromval)
{
register struct type *type;
- register value_ptr val;
+ struct value *val;
char *raw_buffer = (char*) alloca (MAX_REGISTER_RAW_SIZE);
int use_buffer = 0;
/* Extend a value VAL to COUNT repetitions of its type. */
-value_ptr
-value_repeat (value_ptr arg1, int count)
+struct value *
+value_repeat (struct value *arg1, int count)
{
- register value_ptr val;
+ struct value *val;
if (VALUE_LVAL (arg1) != lval_memory)
error ("Only values in memory can be extended with '@'.");
return val;
}
-value_ptr
+struct value *
value_of_variable (struct symbol *var, struct block *b)
{
- value_ptr val;
+ struct value *val;
struct frame_info *frame = NULL;
if (!b)
the coercion to pointer type.
*/
-value_ptr
-value_coerce_array (value_ptr arg1)
+struct value *
+value_coerce_array (struct value *arg1)
{
register struct type *type = check_typedef (VALUE_TYPE (arg1));
/* Given a value which is a function, return a value which is a pointer
to it. */
-value_ptr
-value_coerce_function (value_ptr arg1)
+struct value *
+value_coerce_function (struct value *arg1)
{
- value_ptr retval;
+ struct value *retval;
if (VALUE_LVAL (arg1) != lval_memory)
error ("Attempt to take address of value not located in memory.");
/* Return a pointer value for the object for which ARG1 is the contents. */
-value_ptr
-value_addr (value_ptr arg1)
+struct value *
+value_addr (struct value *arg1)
{
- value_ptr arg2;
+ struct value *arg2;
struct type *type = check_typedef (VALUE_TYPE (arg1));
if (TYPE_CODE (type) == TYPE_CODE_REF)
/* Given a value of a pointer type, apply the C unary * operator to it. */
-value_ptr
-value_ind (value_ptr arg1)
+struct value *
+value_ind (struct value *arg1)
{
struct type *base_type;
- value_ptr arg2;
+ struct value *arg2;
COERCE_ARRAY (arg1);
it to be an argument to a function. */
static CORE_ADDR
-value_push (register CORE_ADDR sp, value_ptr arg)
+value_push (register CORE_ADDR sp, struct value *arg)
{
register int len = TYPE_LENGTH (VALUE_ENCLOSING_TYPE (arg));
register int container_len = len;
#endif
CORE_ADDR
-default_push_arguments (int nargs, value_ptr *args, CORE_ADDR sp,
+default_push_arguments (int nargs, struct value **args, CORE_ADDR sp,
int struct_return, CORE_ADDR struct_addr)
{
/* ASSERT ( !struct_return); */
If PARAM_TYPE is non-NULL, it is the expected parameter type.
IS_PROTOTYPED is non-zero if the function declaration is prototyped. */
-static value_ptr
-value_arg_coerce (value_ptr arg, struct type *param_type, int is_prototyped)
+static struct value *
+value_arg_coerce (struct value *arg, struct type *param_type, int is_prototyped)
{
register struct type *arg_type = check_typedef (VALUE_TYPE (arg));
register struct type *type
Calls error() if the function is not valid for calling. */
static CORE_ADDR
-find_function_addr (value_ptr function, struct type **retval_type)
+find_function_addr (struct value *function, struct type **retval_type)
{
register struct type *ftype = check_typedef (VALUE_TYPE (function));
register enum type_code code = TYPE_CODE (ftype);
ARGS is modified to contain coerced values. */
-static value_ptr hand_function_call (value_ptr function, int nargs,
- value_ptr * args);
-static value_ptr
-hand_function_call (value_ptr function, int nargs, value_ptr *args)
+static struct value *
+hand_function_call (struct value *function, int nargs, struct value **args)
{
register CORE_ADDR sp;
register int i;
#ifdef VALUE_RETURNED_FROM_STACK
if (struct_return)
- return (value_ptr) VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
+ return (struct value *) VALUE_RETURNED_FROM_STACK (value_type, struct_addr);
#endif
return value_being_returned (value_type, retbuf, struct_return);
}
}
-value_ptr
-call_function_by_hand (value_ptr function, int nargs, value_ptr *args)
+struct value *
+call_function_by_hand (struct value *function, int nargs, struct value **args)
{
if (CALL_DUMMY_P)
{
first element, and all elements must have the same size (though we
don't currently enforce any restriction on their types). */
-value_ptr
-value_array (int lowbound, int highbound, value_ptr *elemvec)
+struct value *
+value_array (int lowbound, int highbound, struct value **elemvec)
{
int nelem;
int idx;
unsigned int typelength;
- value_ptr val;
+ struct value *val;
struct type *rangetype;
struct type *arraytype;
CORE_ADDR addr;
zero and an upper bound of LEN - 1. Also note that the string may contain
embedded null bytes. */
-value_ptr
+struct value *
value_string (char *ptr, int len)
{
- value_ptr val;
+ struct value *val;
int lowbound = current_language->string_lower_bound;
struct type *rangetype = create_range_type ((struct type *) NULL,
builtin_type_int,
return (val);
}
-value_ptr
+struct value *
value_bitstring (char *ptr, int len)
{
- value_ptr val;
+ struct value *val;
struct type *domain_type = create_range_type (NULL, builtin_type_int,
0, len - 1);
struct type *type = create_set_type ((struct type *) NULL, domain_type);
requested operation is type secure, shouldn't we? FIXME. */
static int
-typecmp (int staticp, struct type *t1[], value_ptr t2[])
+typecmp (int staticp, struct type *t1[], struct value *t2[])
{
int i;
If LOOKING_FOR_BASECLASS, then instead of looking for struct fields,
look for a baseclass named NAME. */
-static value_ptr
-search_struct_field (char *name, register value_ptr arg1, int offset,
+static struct value *
+search_struct_field (char *name, struct value *arg1, int offset,
register struct type *type, int looking_for_baseclass)
{
int i;
if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
{
- value_ptr v;
+ struct value *v;
if (TYPE_FIELD_STATIC (type, i))
v = value_static_field (type, i);
else
Each <variant alternative> is represented as a struct,
with a member for each <variant field>. */
- value_ptr v;
+ struct value *v;
int new_offset = offset;
/* This is pretty gross. In G++, the offset in an anonymous
for (i = 0; i < nbases; i++)
{
- value_ptr v;
+ struct value *v;
struct type *basetype = check_typedef (TYPE_BASECLASS (type, i));
/* If we are looking for baseclasses, this is what we get when we
hit them. But it could happen that the base part's member name
if (BASETYPE_VIA_VIRTUAL (type, i))
{
int boffset;
- value_ptr v2 = allocate_value (basetype);
+ struct value *v2 = allocate_value (basetype);
boffset = baseclass_offset (type, i,
VALUE_CONTENTS (arg1) + offset,
int index; /* displacement to use in virtual table */
int skip;
- value_ptr vp;
+ struct value *vp;
CORE_ADDR vtbl; /* the virtual table pointer */
struct type *pbc; /* the primary base class */
If found, return value, else if name matched and args not return (value)-1,
else return NULL. */
-static value_ptr
-search_struct_method (char *name, register value_ptr *arg1p,
- register value_ptr *args, int offset,
+static struct value *
+search_struct_method (char *name, struct value **arg1p,
+ struct value **args, int offset,
int *static_memfuncp, register struct type *type)
{
int i;
- value_ptr v;
+ struct value *v;
int name_matched = 0;
char dem_opname[64];
}
v = search_struct_method (name, arg1p, args, base_offset + offset,
static_memfuncp, TYPE_BASECLASS (type, i));
- if (v == (value_ptr) - 1)
+ if (v == (struct value *) - 1)
{
name_matched = 1;
}
}
}
if (name_matched)
- return (value_ptr) - 1;
+ return (struct value *) - 1;
else
return NULL;
}
ERR is an error message to be printed in case the field is not found. */
-value_ptr
-value_struct_elt (register value_ptr *argp, register value_ptr *args,
+struct value *
+value_struct_elt (struct value **argp, struct value **args,
char *name, int *static_memfuncp, char *err)
{
register struct type *t;
- value_ptr v;
+ struct value *v;
COERCE_ARRAY (*argp);
v = search_struct_method (name, argp, args, 0, static_memfuncp, t);
- if (v == (value_ptr) - 1)
+ if (v == (struct value *) - 1)
error ("Cannot take address of a method");
else if (v == 0)
{
else
v = search_struct_method (name, argp, args, 0, static_memfuncp, t);
- if (v == (value_ptr) - 1)
+ if (v == (struct value *) - 1)
{
error ("One of the arguments you tried to pass to %s could not be converted to what the function wants.", name);
}
* BOFFSET is the offset of the base subobject where the method is found */
static struct fn_field *
-find_method_list (value_ptr *argp, char *method, int offset,
+find_method_list (struct value **argp, char *method, int offset,
int *static_memfuncp, struct type *type, int *num_fns,
struct type **basetype, int *boffset)
{
* BOFFSET is the offset of the base subobject which defines the method */
struct fn_field *
-value_find_oload_method_list (value_ptr *argp, char *method, int offset,
+value_find_oload_method_list (struct value **argp, char *method, int offset,
int *static_memfuncp, int *num_fns,
struct type **basetype, int *boffset)
{
int
find_overload_match (struct type **arg_types, int nargs, char *name, int method,
- int lax, value_ptr obj, struct symbol *fsym,
- value_ptr *valp, struct symbol **symp, int *staticp)
+ int lax, struct value *obj, struct symbol *fsym,
+ struct value **valp, struct symbol **symp, int *staticp)
{
int nparms;
struct type **parm_types;
struct badness_vector *bv; /* A measure of how good an overloaded instance is */
struct badness_vector *oload_champ_bv = NULL; /* The measure for the current best match */
- value_ptr temp = obj;
+ struct value *temp = obj;
struct fn_field *fns_ptr = NULL; /* For methods, the list of overloaded methods */
struct symbol **oload_syms = NULL; /* For non-methods, the list of overloaded function symbols */
int num_fns = 0; /* Number of overloaded instances being considered */
target structure/union is defined, otherwise, return 0. */
int
-check_field (register value_ptr arg1, const char *name)
+check_field (struct value *arg1, const char *name)
{
register struct type *t;
"pointers to member functions". This function is used
to resolve user expressions of the form "DOMAIN::NAME". */
-value_ptr
+struct value *
value_struct_elt_for_reference (struct type *domain, int offset,
struct type *curtype, char *name,
struct type *intype)
{
register struct type *t = curtype;
register int i;
- value_ptr v;
+ struct value *v;
if (TYPE_CODE (t) != TYPE_CODE_STRUCT
&& TYPE_CODE (t) != TYPE_CODE_UNION)
}
for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--)
{
- value_ptr v;
+ struct value *v;
int base_offset;
if (BASETYPE_VIA_VIRTUAL (t, i))
and refer to the values computed for the object pointed to. */
struct type *
-value_rtti_target_type (value_ptr v, int *full, int *top, int *using_enc)
+value_rtti_target_type (struct value *v, int *full, int *top, int *using_enc)
{
- value_ptr target;
+ struct value *target;
target = value_ind (v);
they can be supplied and a second call to value_rtti_type() is avoided.
(Pass RTYPE == NULL if they're not available */
-value_ptr
-value_full_object (value_ptr argp, struct type *rtype, int xfull, int xtop,
+struct value *
+value_full_object (struct value *argp, struct type *rtype, int xfull, int xtop,
int xusing_enc)
{
struct type *real_type;
int full = 0;
int top = -1;
int using_enc = 0;
- value_ptr new_val;
+ struct value *new_val;
if (rtype)
{
Flag COMPLAIN signals an error if the request is made in an
inappropriate context. */
-value_ptr
+struct value *
value_of_this (int complain)
{
struct symbol *func, *sym;
struct block *b;
int i;
static const char funny_this[] = "this";
- value_ptr this;
+ struct value *this;
if (selected_frame == 0)
{
long, starting at LOWBOUND. The result has the same lower bound as
the original ARRAY. */
-value_ptr
-value_slice (value_ptr array, int lowbound, int length)
+struct value *
+value_slice (struct value *array, int lowbound, int length)
{
struct type *slice_range_type, *slice_type, *range_type;
LONGEST lowerbound, upperbound, offset;
- value_ptr slice;
+ struct value *slice;
struct type *array_type;
array_type = check_typedef (VALUE_TYPE (array));
COERCE_VARYING_ARRAY (array, array_type);
/* Assuming chill_varying_type (VARRAY) is true, return an equivalent
value as a fixed-length array. */
-value_ptr
-varying_to_slice (value_ptr varray)
+struct value *
+varying_to_slice (struct value *varray)
{
struct type *vtype = check_typedef (VALUE_TYPE (varray));
LONGEST length = unpack_long (TYPE_FIELD_TYPE (vtype, 0),
that figures out precision inteligently as opposed to assuming
doubles. FIXME: fmb */
-value_ptr
-value_literal_complex (value_ptr arg1, value_ptr arg2, struct type *type)
+struct value *
+value_literal_complex (struct value *arg1, struct value *arg2, struct type *type)
{
- register value_ptr val;
+ struct value *val;
struct type *real_type = TYPE_TARGET_TYPE (type);
val = allocate_value (type);
/* Cast a value into the appropriate complex data type. */
-static value_ptr
-cast_into_complex (struct type *type, register value_ptr val)
+static struct value *
+cast_into_complex (struct type *type, struct value *val)
{
struct type *real_type = TYPE_TARGET_TYPE (type);
if (TYPE_CODE (VALUE_TYPE (val)) == TYPE_CODE_COMPLEX)
{
struct type *val_real_type = TYPE_TARGET_TYPE (VALUE_TYPE (val));
- value_ptr re_val = allocate_value (val_real_type);
- value_ptr im_val = allocate_value (val_real_type);
+ struct value *re_val = allocate_value (val_real_type);
+ struct value *im_val = allocate_value (val_real_type);
memcpy (VALUE_CONTENTS_RAW (re_val),
VALUE_CONTENTS (val), TYPE_LENGTH (val_real_type));
/* Definitions for values of C expressions, for GDB.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000, 2001
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GDB.
VALUE_CONTENTS_ALL_RAW(val))
-extern int value_fetch_lazy (value_ptr val);
+extern int value_fetch_lazy (struct value *val);
#define VALUE_LVAL(val) (val)->lval
#define VALUE_ADDRESS(val) (val)->location.address
{
struct internalvar *next;
char *name;
- value_ptr value;
+ struct value *value;
};
/* Pointer to member function. Depends on compiler implementation. */
extern void print_address_demangle (CORE_ADDR, struct ui_file *, int);
-extern LONGEST value_as_long (value_ptr val);
+extern LONGEST value_as_long (struct value *val);
-extern DOUBLEST value_as_double (value_ptr val);
+extern DOUBLEST value_as_double (struct value *val);
-extern CORE_ADDR value_as_address (value_ptr val);
+extern CORE_ADDR value_as_address (struct value *val);
extern LONGEST unpack_long (struct type *type, char *valaddr);
extern LONGEST unpack_field_as_long (struct type *type, char *valaddr,
int fieldno);
-extern value_ptr value_from_longest (struct type *type, LONGEST num);
+extern struct value *value_from_longest (struct type *type, LONGEST num);
-extern value_ptr value_from_pointer (struct type *type, CORE_ADDR addr);
+extern struct value *value_from_pointer (struct type *type, CORE_ADDR addr);
-extern value_ptr value_from_double (struct type *type, DOUBLEST num);
+extern struct value *value_from_double (struct type *type, DOUBLEST num);
-extern value_ptr value_from_string (char *string);
+extern struct value *value_from_string (char *string);
-extern value_ptr value_at (struct type *type, CORE_ADDR addr,
- asection * sect);
+extern struct value *value_at (struct type *type, CORE_ADDR addr,
+ asection * sect);
-extern value_ptr value_at_lazy (struct type *type, CORE_ADDR addr,
- asection * sect);
+extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr,
+ asection * sect);
-extern value_ptr value_from_register (struct type *type, int regnum,
- struct frame_info *frame);
+extern struct value *value_from_register (struct type *type, int regnum,
+ struct frame_info *frame);
-extern value_ptr value_of_variable (struct symbol *var, struct block *b);
+extern struct value *value_of_variable (struct symbol *var, struct block *b);
-extern value_ptr value_of_register (int regnum);
+extern struct value *value_of_register (int regnum);
extern int symbol_read_needs_frame (struct symbol *);
-extern value_ptr read_var_value (struct symbol *var,
- struct frame_info *frame);
+extern struct value *read_var_value (struct symbol *var,
+ struct frame_info *frame);
-extern value_ptr locate_var_value (struct symbol *var,
- struct frame_info *frame);
+extern struct value *locate_var_value (struct symbol *var,
+ struct frame_info *frame);
-extern value_ptr allocate_value (struct type *type);
+extern struct value *allocate_value (struct type *type);
-extern value_ptr allocate_repeat_value (struct type *type, int count);
+extern struct value *allocate_repeat_value (struct type *type, int count);
-extern value_ptr value_change_enclosing_type (value_ptr val, struct type *new_type);
+extern struct value *value_change_enclosing_type (struct value *val,
+ struct type *new_type);
-extern value_ptr value_mark (void);
+extern struct value *value_mark (void);
-extern void value_free_to_mark (value_ptr mark);
+extern void value_free_to_mark (struct value *mark);
-extern value_ptr value_string (char *ptr, int len);
-extern value_ptr value_bitstring (char *ptr, int len);
+extern struct value *value_string (char *ptr, int len);
+extern struct value *value_bitstring (char *ptr, int len);
-extern value_ptr value_array (int lowbound, int highbound,
- value_ptr * elemvec);
+extern struct value *value_array (int lowbound, int highbound,
+ struct value ** elemvec);
-extern value_ptr value_concat (value_ptr arg1, value_ptr arg2);
+extern struct value *value_concat (struct value *arg1, struct value *arg2);
-extern value_ptr value_binop (value_ptr arg1, value_ptr arg2,
- enum exp_opcode op);
+extern struct value *value_binop (struct value *arg1, struct value *arg2,
+ enum exp_opcode op);
-extern value_ptr value_add (value_ptr arg1, value_ptr arg2);
+extern struct value *value_add (struct value *arg1, struct value *arg2);
-extern value_ptr value_sub (value_ptr arg1, value_ptr arg2);
+extern struct value *value_sub (struct value *arg1, struct value *arg2);
-extern value_ptr value_coerce_array (value_ptr arg1);
+extern struct value *value_coerce_array (struct value *arg1);
-extern value_ptr value_coerce_function (value_ptr arg1);
+extern struct value *value_coerce_function (struct value *arg1);
-extern value_ptr value_ind (value_ptr arg1);
+extern struct value *value_ind (struct value *arg1);
-extern value_ptr value_addr (value_ptr arg1);
+extern struct value *value_addr (struct value *arg1);
-extern value_ptr value_assign (value_ptr toval, value_ptr fromval);
+extern struct value *value_assign (struct value *toval, struct value *fromval);
-extern value_ptr value_neg (value_ptr arg1);
+extern struct value *value_neg (struct value *arg1);
-extern value_ptr value_complement (value_ptr arg1);
+extern struct value *value_complement (struct value *arg1);
-extern value_ptr value_struct_elt (value_ptr * argp, value_ptr * args,
- char *name,
- int *static_memfuncp, char *err);
+extern struct value *value_struct_elt (struct value **argp,
+ struct value **args,
+ char *name, int *static_memfuncp,
+ char *err);
-extern value_ptr value_struct_elt_for_reference (struct type *domain,
- int offset,
- struct type *curtype,
- char *name,
- struct type *intype);
+extern struct value *value_struct_elt_for_reference (struct type *domain,
+ int offset,
+ struct type *curtype,
+ char *name,
+ struct type *intype);
-extern value_ptr value_static_field (struct type *type, int fieldno);
+extern struct value *value_static_field (struct type *type, int fieldno);
-extern struct fn_field *value_find_oload_method_list (value_ptr *, char *,
+extern struct fn_field *value_find_oload_method_list (struct value **, char *,
int, int *, int *,
struct type **, int *);
extern int find_overload_match (struct type **arg_types, int nargs,
char *name, int method, int lax,
- value_ptr obj, struct symbol *fsym,
- value_ptr * valp, struct symbol **symp,
+ struct value *obj, struct symbol *fsym,
+ struct value **valp, struct symbol **symp,
int *staticp);
-extern value_ptr value_field (value_ptr arg1, int fieldno);
+extern struct value *value_field (struct value *arg1, int fieldno);
-extern value_ptr value_primitive_field (value_ptr arg1, int offset,
- int fieldno, struct type *arg_type);
+extern struct value *value_primitive_field (struct value *arg1, int offset,
+ int fieldno,
+ struct type *arg_type);
-extern struct type *value_rtti_target_type (value_ptr, int *, int *, int *);
+extern struct type *value_rtti_target_type (struct value *, int *, int *,
+ int *);
-extern value_ptr value_full_object (value_ptr, struct type *, int, int, int);
+extern struct value *value_full_object (struct value *, struct type *, int,
+ int, int);
-extern value_ptr value_cast (struct type *type, value_ptr arg2);
+extern struct value *value_cast (struct type *type, struct value *arg2);
-extern value_ptr value_zero (struct type *type, enum lval_type lv);
+extern struct value *value_zero (struct type *type, enum lval_type lv);
-extern value_ptr value_repeat (value_ptr arg1, int count);
+extern struct value *value_repeat (struct value *arg1, int count);
-extern value_ptr value_subscript (value_ptr array, value_ptr idx);
+extern struct value *value_subscript (struct value *array, struct value *idx);
-extern value_ptr value_from_vtable_info (value_ptr arg, struct type *type);
+extern struct value *value_from_vtable_info (struct value *arg,
+ struct type *type);
-extern value_ptr value_being_returned (struct type *valtype,
- char *retbuf, int struct_return);
+extern struct value *value_being_returned (struct type *valtype,
+ char *retbuf, int struct_return);
-extern value_ptr value_in (value_ptr element, value_ptr set);
+extern struct value *value_in (struct value *element, struct value *set);
extern int value_bit_index (struct type *type, char *addr, int index);
-extern int using_struct_return (value_ptr function, CORE_ADDR funcaddr,
+extern int using_struct_return (struct value *function, CORE_ADDR funcaddr,
struct type *value_type, int gcc_p);
-extern void set_return_value (value_ptr val);
+extern void set_return_value (struct value *val);
-extern value_ptr evaluate_expression (struct expression *exp);
+extern struct value *evaluate_expression (struct expression *exp);
-extern value_ptr evaluate_type (struct expression *exp);
+extern struct value *evaluate_type (struct expression *exp);
-extern value_ptr evaluate_subexp_with_coercion (struct expression *,
- int *, enum noside);
+extern struct value *evaluate_subexp_with_coercion (struct expression *,
+ int *, enum noside);
-extern value_ptr parse_and_eval (char *exp);
+extern struct value *parse_and_eval (char *exp);
-extern value_ptr parse_to_comma_and_eval (char **expp);
+extern struct value *parse_to_comma_and_eval (char **expp);
extern struct type *parse_and_eval_type (char *p, int length);
extern LONGEST parse_and_eval_long (char *exp);
-extern value_ptr access_value_history (int num);
+extern struct value *access_value_history (int num);
-extern value_ptr value_of_internalvar (struct internalvar *var);
+extern struct value *value_of_internalvar (struct internalvar *var);
-extern void set_internalvar (struct internalvar *var, value_ptr val);
+extern void set_internalvar (struct internalvar *var, struct value *val);
extern void set_internalvar_component (struct internalvar *var,
int offset,
int bitpos, int bitsize,
- value_ptr newvalue);
+ struct value *newvalue);
extern struct internalvar *lookup_internalvar (char *name);
-extern int value_equal (value_ptr arg1, value_ptr arg2);
+extern int value_equal (struct value *arg1, struct value *arg2);
-extern int value_less (value_ptr arg1, value_ptr arg2);
+extern int value_less (struct value *arg1, struct value *arg2);
-extern int value_logical_not (value_ptr arg1);
+extern int value_logical_not (struct value *arg1);
/* C++ */
-extern value_ptr value_of_this (int complain);
+extern struct value *value_of_this (int complain);
-extern value_ptr value_x_binop (value_ptr arg1, value_ptr arg2,
- enum exp_opcode op,
- enum exp_opcode otherop, enum noside noside);
+extern struct value *value_x_binop (struct value *arg1, struct value *arg2,
+ enum exp_opcode op,
+ enum exp_opcode otherop,
+ enum noside noside);
-extern value_ptr value_x_unop (value_ptr arg1, enum exp_opcode op,
- enum noside noside);
+extern struct value *value_x_unop (struct value *arg1, enum exp_opcode op,
+ enum noside noside);
-extern value_ptr value_fn_field (value_ptr * arg1p, struct fn_field *f,
- int j, struct type *type, int offset);
+extern struct value *value_fn_field (struct value ** arg1p, struct fn_field *f,
+ int j, struct type *type, int offset);
-extern int binop_user_defined_p (enum exp_opcode op,
- value_ptr arg1, value_ptr arg2);
+extern int binop_user_defined_p (enum exp_opcode op, struct value *arg1,
+ struct value *arg2);
-extern int unop_user_defined_p (enum exp_opcode op, value_ptr arg1);
+extern int unop_user_defined_p (enum exp_opcode op, struct value *arg1);
extern int destructor_name_p (const char *name, const struct type *type);
extern void free_all_values (void);
-extern void release_value (value_ptr val);
+extern void release_value (struct value *val);
-extern int record_latest_value (value_ptr val);
+extern int record_latest_value (struct value *val);
extern void
modify_field (char *addr, LONGEST fieldval, int bitpos, int bitsize);
extern void type_print (struct type * type, char *varstring,
struct ui_file * stream, int show);
-extern char *baseclass_addr (struct type *type, int index,
- char *valaddr, value_ptr * valuep, int *errp);
+extern char *baseclass_addr (struct type *type, int index, char *valaddr,
+ struct value **valuep, int *errp);
extern void print_longest (struct ui_file * stream, int format,
int use_local, LONGEST val);
extern void print_floating (char *valaddr, struct type * type,
struct ui_file * stream);
-extern int value_print (value_ptr val, struct ui_file *stream, int format,
+extern int value_print (struct value *val, struct ui_file *stream, int format,
enum val_prettyprint pretty);
-extern void value_print_array_elements (value_ptr val,
- struct ui_file *stream,
- int format,
+extern void value_print_array_elements (struct value *val,
+ struct ui_file *stream, int format,
enum val_prettyprint pretty);
-extern value_ptr value_release_to_mark (value_ptr mark);
+extern struct value *value_release_to_mark (struct value *mark);
extern int val_print (struct type * type, char *valaddr,
int embedded_offset, CORE_ADDR address,
struct frame_info * frame,
struct ui_file *stream);
-extern int check_field (value_ptr, const char *);
+extern int check_field (struct value *, const char *);
extern void typedef_print (struct type * type, struct symbol * news,
struct ui_file * stream);
/* From values.c */
-extern value_ptr value_copy (value_ptr);
+extern struct value *value_copy (struct value *);
extern int baseclass_offset (struct type *, int, char *, CORE_ADDR);
/* From valops.c */
-extern value_ptr varying_to_slice (value_ptr);
+extern struct value *varying_to_slice (struct value *);
-extern value_ptr value_slice (value_ptr, int, int);
+extern struct value *value_slice (struct value *, int, int);
-extern value_ptr call_function_by_hand (value_ptr, int, value_ptr *);
+extern struct value *call_function_by_hand (struct value *, int,
+ struct value **);
extern int default_coerce_float_to_double (struct type *, struct type *);
extern int standard_coerce_float_to_double (struct type *, struct type *);
-extern value_ptr value_literal_complex (value_ptr, value_ptr, struct type *);
+extern struct value *value_literal_complex (struct value *, struct value *,
+ struct type *);
extern void find_rt_vbase_offset (struct type *, struct type *, char *, int,
int *, int *);
-extern value_ptr find_function_in_inferior (char *);
+extern struct value *find_function_in_inferior (char *);
-extern value_ptr value_allocate_space_in_inferior (int);
+extern struct value *value_allocate_space_in_inferior (int);
-extern CORE_ADDR default_push_arguments (int nargs, value_ptr * args,
- CORE_ADDR sp,
- int struct_return,
+extern CORE_ADDR default_push_arguments (int nargs, struct value ** args,
+ CORE_ADDR sp, int struct_return,
CORE_ADDR struct_addr);
#endif /* !defined (VALUE_H) */
/* Low level packing and unpacking of values for GDB, the GNU Debugger.
- Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
- 1996, 1997, 1998, 1999, 2000
+ Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
+ 1995, 1996, 1997, 1998, 1999, 2000, 2002.
Free Software Foundation, Inc.
This file is part of GDB.
/* Prototypes for local functions. */
-static value_ptr value_headof (value_ptr, struct type *, struct type *);
+static struct value *value_headof (struct value *, struct type *, struct type *);
static void show_values (char *, int);
struct value_history_chunk
{
struct value_history_chunk *next;
- value_ptr values[VALUE_HISTORY_CHUNK];
+ struct value *values[VALUE_HISTORY_CHUNK];
};
/* Chain of chunks now in use. */
(except for those released by calls to release_value)
This is so they can be freed after each command. */
-static value_ptr all_values;
+static struct value *all_values;
/* Allocate a value that has the correct length for type TYPE. */
-value_ptr
+struct value *
allocate_value (struct type *type)
{
- register value_ptr val;
+ struct value *val;
struct type *atype = check_typedef (type);
val = (struct value *) xmalloc (sizeof (struct value) + TYPE_LENGTH (atype));
/* Allocate a value that has the correct length
for COUNT repetitions type TYPE. */
-value_ptr
+struct value *
allocate_repeat_value (struct type *type, int count)
{
int low_bound = current_language->string_lower_bound; /* ??? */
/* Return a mark in the value chain. All values allocated after the
mark is obtained (except for those released) are subject to being freed
if a subsequent value_free_to_mark is passed the mark. */
-value_ptr
+struct value *
value_mark (void)
{
return all_values;
/* Free all values allocated since MARK was obtained by value_mark
(except for those released). */
void
-value_free_to_mark (value_ptr mark)
+value_free_to_mark (struct value *mark)
{
- value_ptr val, next;
+ struct value *val;
+ struct value *next;
for (val = all_values; val && val != mark; val = next)
{
void
free_all_values (void)
{
- register value_ptr val, next;
+ struct value *val;
+ struct value *next;
for (val = all_values; val; val = next)
{
so it will not be freed automatically. */
void
-release_value (register value_ptr val)
+release_value (struct value *val)
{
- register value_ptr v;
+ struct value *v;
if (all_values == val)
{
}
/* Release all values up to mark */
-value_ptr
-value_release_to_mark (value_ptr mark)
+struct value *
+value_release_to_mark (struct value *mark)
{
- value_ptr val, next;
+ struct value *val;
+ struct value *next;
for (val = next = all_values; next; next = VALUE_NEXT (next))
if (VALUE_NEXT (next) == mark)
It contains the same contents, for same memory address,
but it's a different block of storage. */
-value_ptr
-value_copy (value_ptr arg)
+struct value *
+value_copy (struct value *arg)
{
register struct type *encl_type = VALUE_ENCLOSING_TYPE (arg);
- register value_ptr val = allocate_value (encl_type);
+ struct value *val = allocate_value (encl_type);
VALUE_TYPE (val) = VALUE_TYPE (arg);
VALUE_LVAL (val) = VALUE_LVAL (arg);
VALUE_ADDRESS (val) = VALUE_ADDRESS (arg);
value history index of this new item. */
int
-record_latest_value (value_ptr val)
+record_latest_value (struct value *val)
{
int i;
i = value_history_count % VALUE_HISTORY_CHUNK;
if (i == 0)
{
- register struct value_history_chunk *new
+ struct value_history_chunk *new
= (struct value_history_chunk *)
xmalloc (sizeof (struct value_history_chunk));
memset (new->values, 0, sizeof new->values);
/* Return a copy of the value in the history with sequence number NUM. */
-value_ptr
+struct value *
access_value_history (int num)
{
- register struct value_history_chunk *chunk;
+ struct value_history_chunk *chunk;
register int i;
register int absnum = num;
void
clear_value_history (void)
{
- register struct value_history_chunk *next;
+ struct value_history_chunk *next;
register int i;
- register value_ptr val;
+ struct value *val;
while (value_history_chain)
{
show_values (char *num_exp, int from_tty)
{
register int i;
- register value_ptr val;
+ struct value *val;
static int num = 1;
if (num_exp)
return var;
}
-value_ptr
+struct value *
value_of_internalvar (struct internalvar *var)
{
- register value_ptr val;
+ struct value *val;
#ifdef IS_TRAPPED_INTERNALVAR
if (IS_TRAPPED_INTERNALVAR (var->name))
void
set_internalvar_component (struct internalvar *var, int offset, int bitpos,
- int bitsize, value_ptr newval)
+ int bitsize, struct value *newval)
{
register char *addr = VALUE_CONTENTS (var->value) + offset;
}
void
-set_internalvar (struct internalvar *var, value_ptr val)
+set_internalvar (struct internalvar *var, struct value *val)
{
- value_ptr newval;
+ struct value *newval;
#ifdef IS_TRAPPED_INTERNALVAR
if (IS_TRAPPED_INTERNALVAR (var->name))
Does not deallocate the value. */
LONGEST
-value_as_long (register value_ptr val)
+value_as_long (struct value *val)
{
/* This coerces arrays and functions, which is necessary (e.g.
in disassemble_command). It also dereferences references, which
}
DOUBLEST
-value_as_double (register value_ptr val)
+value_as_double (struct value *val)
{
DOUBLEST foo;
int inv;
Note that val's type may not actually be a pointer; value_as_long
handles all the cases. */
CORE_ADDR
-value_as_address (value_ptr val)
+value_as_address (struct value *val)
{
/* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure
whether we want this to be true eventually. */
\f
/* Get the value of the FIELDN'th field (which must be static) of TYPE. */
-value_ptr
+struct value *
value_static_field (struct type *type, int fieldno)
{
CORE_ADDR addr;
than the old enclosing type, you have to allocate more space for the data.
The return value is a pointer to the new version of this value structure. */
-value_ptr
-value_change_enclosing_type (value_ptr val, struct type *new_encl_type)
+struct value *
+value_change_enclosing_type (struct value *val, struct type *new_encl_type)
{
if (TYPE_LENGTH (new_encl_type) <= TYPE_LENGTH (VALUE_ENCLOSING_TYPE (val)))
{
}
else
{
- value_ptr new_val;
- register value_ptr prev;
+ struct value *new_val;
+ struct value *prev;
- new_val = (value_ptr) xrealloc (val, sizeof (struct value) + TYPE_LENGTH (new_encl_type));
+ new_val = (struct value *) xrealloc (val, sizeof (struct value) + TYPE_LENGTH (new_encl_type));
/* We have to make sure this ends up in the same place in the value
chain as the original copy, so it's clean-up behavior is the same.
extract and return the value of one of its (non-static) fields.
FIELDNO says which field. */
-value_ptr
-value_primitive_field (register value_ptr arg1, int offset,
+struct value *
+value_primitive_field (struct value *arg1, int offset,
register int fieldno, register struct type *arg_type)
{
- register value_ptr v;
+ struct value *v;
register struct type *type;
CHECK_TYPEDEF (arg_type);
extract and return the value of one of its (non-static) fields.
FIELDNO says which field. */
-value_ptr
-value_field (register value_ptr arg1, register int fieldno)
+struct value *
+value_field (struct value *arg1, register int fieldno)
{
return value_primitive_field (arg1, 0, fieldno, VALUE_TYPE (arg1));
}
full symbol or a minimal symbol.
*/
-value_ptr
-value_fn_field (value_ptr *arg1p, struct fn_field *f, int j, struct type *type,
+struct value *
+value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type,
int offset)
{
- register value_ptr v;
+ struct value *v;
register struct type *ftype = TYPE_FN_FIELD_TYPE (f, j);
char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
struct symbol *sym;
by value_rtti_type efficiently.
Consider it gone for 5.1. */
-static value_ptr
-value_headof (value_ptr in_arg, struct type *btype, struct type *dtype)
+static struct value *
+value_headof (struct value *in_arg, struct type *btype, struct type *dtype)
{
/* First collect the vtables we must look at for this object. */
- value_ptr arg, vtbl;
+ struct value *arg;
+ struct value *vtbl;
struct symbol *sym;
char *demangled_name;
struct minimal_symbol *msymbol;
of its baseclasses) to figure out the most derived type that ARG
could actually be a pointer to. */
-value_ptr
-value_from_vtable_info (value_ptr arg, struct type *type)
+struct value *
+value_from_vtable_info (struct value *arg, struct type *type)
{
/* Take care of preliminaries. */
if (TYPE_VPTR_FIELDNO (type) < 0)
\f
/* Convert C numbers into newly allocated values */
-value_ptr
+struct value *
value_from_longest (struct type *type, register LONGEST num)
{
- register value_ptr val = allocate_value (type);
+ struct value *val = allocate_value (type);
register enum type_code code;
register int len;
retry:
/* Create a value representing a pointer of type TYPE to the address
ADDR. */
-value_ptr
+struct value *
value_from_pointer (struct type *type, CORE_ADDR addr)
{
- value_ptr val = allocate_value (type);
+ struct value *val = allocate_value (type);
store_typed_address (VALUE_CONTENTS_RAW (val), type, addr);
return val;
}
This is analogous to value_from_longest, which also does not
use inferior memory. String shall NOT contain embedded nulls. */
-value_ptr
+struct value *
value_from_string (char *ptr)
{
- value_ptr val;
+ struct value *val;
int len = strlen (ptr);
int lowbound = current_language->string_lower_bound;
struct type *rangetype =
return val;
}
-value_ptr
+struct value *
value_from_double (struct type *type, DOUBLEST num)
{
- register value_ptr val = allocate_value (type);
+ struct value *val = allocate_value (type);
struct type *base_type = check_typedef (type);
register enum type_code code = TYPE_CODE (base_type);
register int len = TYPE_LENGTH (base_type);
means returning pointer to where structure is vs. returning value). */
/* ARGSUSED */
-value_ptr
+struct value *
value_being_returned (struct type *valtype, char *retbuf, int struct_return)
{
- register value_ptr val;
+ struct value *val;
CORE_ADDR addr;
/* If this is not defined, just use EXTRACT_RETURN_VALUE instead. */
/* ARGSUSED */
int
-using_struct_return (value_ptr function, CORE_ADDR funcaddr,
+using_struct_return (struct value *function, CORE_ADDR funcaddr,
struct type *value_type, int gcc_p)
{
register enum type_code code = TYPE_CODE (value_type);
function wants to return. */
void
-set_return_value (value_ptr val)
+set_return_value (struct value *val)
{
struct type *type = check_typedef (VALUE_TYPE (val));
register enum type_code code = TYPE_CODE (type);