summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
55bc2f3)
* value.h (deprecated_set_value_type): Declare.
* value.c (deprecated_set_value_type): Define.
* hpacc-abi.c, gnu-v2-abi.c, cp-valprint.c: Update.
* c-valprint.c, jv-lang.c, objc-lang.c, ada-lang.c: Update.
* infcall.c, printcmd.c, valops.c, eval.c, p-exp.y: Update.
* ax-gdb.c, tracepoint.c: Update.
17 files changed:
2005-02-07 Andrew Cagney <cagney@gnu.org>
2005-02-07 Andrew Cagney <cagney@gnu.org>
+ * value.h (deprecated_set_value_type): Declare.
+ * value.c (deprecated_set_value_type): Define.
+ * hpacc-abi.c, gnu-v2-abi.c, cp-valprint.c: Update.
+ * c-valprint.c, jv-lang.c, objc-lang.c, ada-lang.c: Update.
+ * infcall.c, printcmd.c, valops.c, eval.c, p-exp.y: Update.
+ * ax-gdb.c, tracepoint.c: Update.
+
* value.h (deprecated_value_lval_hack)
(deprecated_value_address_hack)
(deprecated_value_internalvar_hack)
* value.h (deprecated_value_lval_hack)
(deprecated_value_address_hack)
(deprecated_value_internalvar_hack)
struct value *mark = value_mark ();
struct value *dummy = value_from_longest (builtin_type_long, 0);
struct type *result;
struct value *mark = value_mark ();
struct value *dummy = value_from_longest (builtin_type_long, 0);
struct type *result;
+ deprecated_set_value_type (dummy, type);
result = ada_type_of_array (dummy, 0);
value_free_to_mark (mark);
return result;
result = ada_type_of_array (dummy, 0);
value_free_to_mark (mark);
return result;
val = value_copy (toval);
memcpy (value_contents_raw (val), value_contents (fromval),
TYPE_LENGTH (type));
val = value_copy (toval);
memcpy (value_contents_raw (val), value_contents (fromval),
TYPE_LENGTH (type));
+ deprecated_set_value_type (val, type);
|| TYPE_LENGTH (TYPE_TARGET_TYPE (type2))
!= TYPE_LENGTH (TYPE_TARGET_TYPE (type2)))
error (_("Incompatible types in assignment"));
|| TYPE_LENGTH (TYPE_TARGET_TYPE (type2))
!= TYPE_LENGTH (TYPE_TARGET_TYPE (type2)))
error (_("Incompatible types in assignment"));
+ deprecated_set_value_type (val, type);
if (!v)
error (_("Right operand of `@' must be a constant, in agent expressions."));
if (!v)
error (_("Right operand of `@' must be a constant, in agent expressions."));
- if (TYPE_CODE (v->type) != TYPE_CODE_INT)
+ if (TYPE_CODE (value_type (v)) != TYPE_CODE_INT)
error (_("Right operand of `@' must be an integer."));
length = value_as_long (v);
if (length <= 0)
error (_("Right operand of `@' must be an integer."));
length = value_as_long (v);
if (length <= 0)
*/
struct value *temparg;
temparg=value_copy(val);
*/
struct value *temparg;
temparg=value_copy(val);
- temparg->type = lookup_pointer_type (TYPE_TARGET_TYPE(type));
+ deprecated_set_value_type (temparg, lookup_pointer_type (TYPE_TARGET_TYPE(type)));
val=temparg;
}
/* Pointer to class, check real type of object */
val=temparg;
}
/* Pointer to class, check real type of object */
/* adjust by offset */
vf->aligner.contents[0] += 4 * (HP_ACC_VFUNC_START + vx);
vf = value_ind (vf); /* get the entry */
/* adjust by offset */
vf->aligner.contents[0] += 4 * (HP_ACC_VFUNC_START + vx);
vf = value_ind (vf); /* get the entry */
- vf->type = value_type (v); /* make it a pointer */
+ /* make it a pointer */
+ deprecated_set_value_type (vf, value_type (v));
/* print out the entry */
val_print (value_type (vf), value_contents (vf), 0, 0,
/* print out the entry */
val_print (value_type (vf), value_contents (vf), 0, 0,
if (gnu_runtime && (method != NULL))
{
/* Function objc_msg_lookup returns a pointer. */
if (gnu_runtime && (method != NULL))
{
/* Function objc_msg_lookup returns a pointer. */
- argvec[0]->type
- = lookup_function_type (lookup_pointer_type (value_type (argvec[0])));
+ deprecated_set_value_type (argvec[0],
+ lookup_function_type (lookup_pointer_type (value_type (argvec[0]))));
argvec[0] = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
}
argvec[0] = call_function_by_hand (argvec[0], nargs + 2, argvec + 1);
}
- arg1->type = lookup_pointer_type (TYPE_TARGET_TYPE (value_type (arg1)));
+ deprecated_set_value_type (arg1, lookup_pointer_type (TYPE_TARGET_TYPE (value_type (arg1))));
type, this will ensure that value_subscript()
returns the correct type value */
type, this will ensure that value_subscript()
returns the correct type value */
+ deprecated_set_value_type (arg1, tmp_type);
return value_ind (value_add (value_coerce_array (arg1), arg2));
}
return value_ind (value_add (value_coerce_array (arg1), arg2));
}
else
error ("I'm confused: virtual function table has bad type");
/* Reinstantiate the function pointer with the correct type. */
else
error ("I'm confused: virtual function table has bad type");
/* Reinstantiate the function pointer with the correct type. */
- vfn->type = lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j));
+ deprecated_set_value_type (vfn, lookup_pointer_type (TYPE_FN_FIELD_TYPE (f, j)));
*arg1p = arg1;
return vfn;
*arg1p = arg1;
return vfn;
/* Wrap this addr in a value and return pointer */
vp = allocate_value (ftype);
/* Wrap this addr in a value and return pointer */
vp = allocate_value (ftype);
+ deprecated_set_value_type (vp, ftype);
VALUE_ADDRESS (vp) = coreptr;
/* pai: (temp) do we need the value_ind stuff in value_fn_field? */
VALUE_ADDRESS (vp) = coreptr;
/* pai: (temp) do we need the value_ind stuff in value_fn_field? */
&& TYPE_CODE (arg_type) != TYPE_CODE_PTR)
{
arg = value_addr (arg);
&& TYPE_CODE (arg_type) != TYPE_CODE_PTR)
{
arg = value_addr (arg);
- arg->type = param_type;
+ deprecated_set_value_type (arg, param_type);
temp = clas;
/* Set array element type. */
temp = value_struct_elt (&temp, NULL, "methods", NULL, "structure");
temp = clas;
/* Set array element type. */
temp = value_struct_elt (&temp, NULL, "methods", NULL, "structure");
- temp->type = lookup_pointer_type (value_type (clas));
+ deprecated_set_value_type (temp, lookup_pointer_type (value_type (clas)));
TYPE_TARGET_TYPE (type) = type_from_class (temp);
}
TYPE_TARGET_TYPE (type) = type_from_class (temp);
}
/* Get CLASS_ELEMENT_TYPE of the array type. */
temp = value_struct_elt (&temp, NULL, "methods",
NULL, "structure");
/* Get CLASS_ELEMENT_TYPE of the array type. */
temp = value_struct_elt (&temp, NULL, "methods",
NULL, "structure");
- temp->type = value_type (clas);
+ deprecated_set_value_type (temp, value_type (clas));
el_type = type_from_class (temp);
if (TYPE_CODE (el_type) == TYPE_CODE_STRUCT)
el_type = lookup_pointer_type (el_type);
el_type = type_from_class (temp);
if (TYPE_CODE (el_type) == TYPE_CODE_STRUCT)
el_type = lookup_pointer_type (el_type);
else
error ("NSString: internal error -- no way to create new NSString");
else
error ("NSString: internal error -- no way to create new NSString");
- nsstringValue->type = type;
+ deprecated_set_value_type (nsstringValue, type);
/* we need type of this */
this_val = value_of_this (0);
if (this_val)
/* we need type of this */
this_val = value_of_this (0);
if (this_val)
- this_type = this_val->type;
+ this_type = value_type (this_val);
else
this_type = NULL;
if (this_type)
else
this_type = NULL;
if (this_type)
/* we need type of this */
this_val = value_of_this (0);
if (this_val)
/* we need type of this */
this_val = value_of_this (0);
if (this_val)
- this_type = this_val->type;
+ this_type = value_type (this_val);
else
this_type = NULL;
if (this_type)
else
this_type = NULL;
if (this_type)
{
struct type *type = value_type (val_args[nargs]);
if (TYPE_LENGTH (type) == sizeof (float))
{
struct type *type = value_type (val_args[nargs]);
if (TYPE_LENGTH (type) == sizeof (float))
- val_args[nargs]->type = builtin_type_float;
+ deprecated_set_value_type (val_args[nargs], builtin_type_float);
if (TYPE_LENGTH (type) == sizeof (double))
if (TYPE_LENGTH (type) == sizeof (double))
- val_args[nargs]->type = builtin_type_double;
+ deprecated_set_value_type (val_args[nargs], builtin_type_double);
func_string = create_array_type (func_string,
builtin_type_char, func_range);
func_val = allocate_value (func_string);
func_string = create_array_type (func_string,
builtin_type_char, func_range);
func_val = allocate_value (func_string);
- func_val->type = func_string;
+ deprecated_set_value_type (func_val, func_string);
memcpy (value_contents_raw (func_val),
DEPRECATED_SYMBOL_NAME (traceframe_fun),
len);
memcpy (value_contents_raw (func_val),
DEPRECATED_SYMBOL_NAME (traceframe_fun),
len);
file_string = create_array_type (file_string,
builtin_type_char, file_range);
file_val = allocate_value (file_string);
file_string = create_array_type (file_string,
builtin_type_char, file_range);
file_val = allocate_value (file_string);
- file_val->type = file_string;
+ deprecated_set_value_type (file_val, file_string);
memcpy (value_contents_raw (file_val),
traceframe_sal.symtab->filename,
len);
memcpy (value_contents_raw (file_val),
traceframe_sal.symtab->filename,
len);
TYPE_TARGET_TYPE (range_type),
low_bound,
new_length + low_bound - 1);
TYPE_TARGET_TYPE (range_type),
low_bound,
new_length + low_bound - 1);
- arg2->type = create_array_type ((struct type *) NULL,
- element_type, range_type);
+ deprecated_set_value_type (arg2, create_array_type ((struct type *) NULL,
+ element_type, range_type));
arg2, 0, type2, 1);
if (v)
{
arg2, 0, type2, 1);
if (v)
{
+ deprecated_set_value_type (v, type);
if (v)
{
v = value_addr (v);
if (v)
{
v = value_addr (v);
+ deprecated_set_value_type (v, type);
}
/* No superclass found, just fall through to change ptr type. */
}
}
/* No superclass found, just fall through to change ptr type. */
}
+ deprecated_set_value_type (arg2, type);
arg2 = value_change_enclosing_type (arg2, type);
set_value_pointed_to_offset (arg2, 0); /* pai: chk_val */
return arg2;
arg2 = value_change_enclosing_type (arg2, type);
set_value_pointed_to_offset (arg2, 0); /* pai: chk_val */
return arg2;
val = value_copy (toval);
memcpy (value_contents_raw (val), value_contents (fromval),
TYPE_LENGTH (type));
val = value_copy (toval);
memcpy (value_contents_raw (val), value_contents (fromval),
TYPE_LENGTH (type));
+ deprecated_set_value_type (val, type);
val = value_change_enclosing_type (val, value_enclosing_type (fromval));
set_value_embedded_offset (val, value_embedded_offset (fromval));
set_value_pointed_to_offset (val, value_pointed_to_offset (fromval));
val = value_change_enclosing_type (val, value_enclosing_type (fromval));
set_value_embedded_offset (val, value_embedded_offset (fromval));
set_value_pointed_to_offset (val, value_pointed_to_offset (fromval));
We keep the same location information, which is efficient,
and allows &(&X) to get the location containing the reference. */
arg2 = value_copy (arg1);
We keep the same location information, which is efficient,
and allows &(&X) to get the location containing the reference. */
arg2 = value_copy (arg1);
- arg2->type = lookup_pointer_type (TYPE_TARGET_TYPE (type));
+ deprecated_set_value_type (arg2, lookup_pointer_type (TYPE_TARGET_TYPE (type)));
return arg2;
}
if (TYPE_CODE (type) == TYPE_CODE_FUNC)
return arg2;
}
if (TYPE_CODE (type) == TYPE_CODE_FUNC)
arg2 = value_at_lazy (enc_type, (value_as_address (arg1)
- value_pointed_to_offset (arg1)));
/* Re-adjust type */
arg2 = value_at_lazy (enc_type, (value_as_address (arg1)
- value_pointed_to_offset (arg1)));
/* Re-adjust type */
- arg2->type = TYPE_TARGET_TYPE (base_type);
+ deprecated_set_value_type (arg2, TYPE_TARGET_TYPE (base_type));
/* Add embedding info */
arg2 = value_change_enclosing_type (arg2, enc_type);
set_value_embedded_offset (arg2, value_pointed_to_offset (arg1));
/* Add embedding info */
arg2 = value_change_enclosing_type (arg2, enc_type);
set_value_embedded_offset (arg2, value_pointed_to_offset (arg1));
used for its computation. */
new_val = value_at_lazy (real_type, VALUE_ADDRESS (argp) - top +
(using_enc ? 0 : value_embedded_offset (argp)));
used for its computation. */
new_val = value_at_lazy (real_type, VALUE_ADDRESS (argp) - top +
(using_enc ? 0 : value_embedded_offset (argp)));
- new_val->type = value_type (argp);
+ deprecated_set_value_type (new_val, value_type (argp));
set_value_embedded_offset (new_val, (using_enc
? top + value_embedded_offset (argp)
: top));
set_value_embedded_offset (new_val, (using_enc
? top + value_embedded_offset (argp)
: top));
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* Hack so that value.h can detect when it's being included by
+ value.c. */
+#define VALUE_C
+
#include "defs.h"
#include "gdb_string.h"
#include "symtab.h"
#include "defs.h"
#include "gdb_string.h"
#include "symtab.h"
+void
+deprecated_set_value_type (struct value *value, struct type *type)
+{
+ value->type = type;
+}
int
value_offset (struct value *value)
int
value_offset (struct value *value)
struct frame_id frame_id;
/* Type of the value. */
struct frame_id frame_id;
/* Type of the value. */
+#else
+ struct type *xtype;
+#endif
/* If a value represents a C++ object, then the `type' field gives
the object's compile-time type. If the object actually belongs
/* If a value represents a C++ object, then the `type' field gives
the object's compile-time type. If the object actually belongs
extern struct type *value_type (struct value *);
extern struct type *value_type (struct value *);
+/* This is being used to change the type of an existing value, that
+ code should instead be creating a new value with the changed type
+ (but possibly shared content). */
+extern void deprecated_set_value_type (struct value *value,
+ struct type *type);
extern int value_bitsize (struct value *);
extern int value_bitpos (struct value *);
extern int value_offset (struct value *);
extern int value_bitsize (struct value *);
extern int value_bitpos (struct value *);
extern int value_offset (struct value *);