* value.h (struct value): Delete field bfd_section.
(VALUE_BFD_SECTION): Delete macro.
(COERCE_REF): Update.
(value_at, value_at_lazy): Delete asection parameter.
* printcmd.c (print_formatted, x_command): Update.
(do_examine): Delete asection parameter.
(next_section): Delete variable.
* valops.c (value_cast, value_at, value_at_lazy)
(value_coerce_function, value_addr, value_ind, value_string)
(find_rt_vbase_offset, value_full_object): Update.
* hpacc-abi.c (hpacc_virtual_fn_field)
(hpacc_value_rtti_type): Update.
* gnu-v3-abi.c (gnuv3_rtti_type, gnuv3_virtual_fn_field)
(gnuv3_baseclass_offset): Update.
* f-valprint.c (f_val_print): Update.
* c-valprint.c (c_val_print): Update.
* p-valprint.c (pascal_val_print): Update.
* jv-valprint.c (java_value_print): Update.
* jv-lang.c (java_class_from_object, evaluate_subexp_java): Update.
* ada-lang.c (ada_value_primitive_packed_val)
(ada_evaluate_subexp): Update.
* dwarf2loc.c (dwarf2_evaluate_loc_desc): Update.
* expprint.c (print_subexp_standard): Update.
* infcall.c (call_function_by_hand): Update.
* valarith.c (value_add): Update.
* eval.c (evaluate_subexp_standard): Update.
* values.c (allocate_value, value_copy, value_static_field): Update.
* findvar.c (read_var_value, locate_var_value): Update.
2004-11-09 Andrew Cagney <cagney@gnu.org>
+ * value.h (struct value): Delete field bfd_section.
+ (VALUE_BFD_SECTION): Delete macro.
+ (COERCE_REF): Update.
+ (value_at, value_at_lazy): Delete asection parameter.
+ * printcmd.c (print_formatted, x_command): Update.
+ (do_examine): Delete asection parameter.
+ (next_section): Delete variable.
+ * valops.c (value_cast, value_at, value_at_lazy)
+ (value_coerce_function, value_addr, value_ind, value_string)
+ (find_rt_vbase_offset, value_full_object): Update.
+ * hpacc-abi.c (hpacc_virtual_fn_field)
+ (hpacc_value_rtti_type): Update.
+ * gnu-v3-abi.c (gnuv3_rtti_type, gnuv3_virtual_fn_field)
+ (gnuv3_baseclass_offset): Update.
+ * f-valprint.c (f_val_print): Update.
+ * c-valprint.c (c_val_print): Update.
+ * p-valprint.c (pascal_val_print): Update.
+ * jv-valprint.c (java_value_print): Update.
+ * jv-lang.c (java_class_from_object, evaluate_subexp_java): Update.
+ * ada-lang.c (ada_value_primitive_packed_val)
+ (ada_evaluate_subexp): Update.
+ * dwarf2loc.c (dwarf2_evaluate_loc_desc): Update.
+ * expprint.c (print_subexp_standard): Update.
+ * infcall.c (call_function_by_hand): Update.
+ * valarith.c (value_add): Update.
+ * eval.c (evaluate_subexp_standard): Update.
+ * values.c (allocate_value, value_copy, value_static_field): Update.
+ * findvar.c (read_var_value, locate_var_value): Update.
+
+2004-11-09 Andrew Cagney <cagney@gnu.org>
+
* i386-linux-tdep.c: Include "dwarf2-frame.h".
* Makefile.in: Update all dependencies.
else if (VALUE_LAZY (obj))
{
v = value_at (type,
- VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset, NULL);
+ VALUE_ADDRESS (obj) + VALUE_OFFSET (obj) + offset);
bytes = (unsigned char *) alloca (len);
read_memory (VALUE_ADDRESS (v), bytes, len);
}
struct type *arrType = ada_type_of_array (arg1, 0);
if (arrType == NULL)
error ("Attempt to dereference null array pointer.");
- return value_at_lazy (arrType, 0, NULL);
+ return value_at_lazy (arrType, 0);
}
else if (TYPE_CODE (type) == TYPE_CODE_PTR
|| TYPE_CODE (type) == TYPE_CODE_REF
{
wtype = TYPE_TARGET_TYPE (type);
}
- vt_val = value_at (wtype, vt_address, NULL);
+ vt_val = value_at (wtype, vt_address);
val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0,
VALUE_ADDRESS (vt_val), stream, format,
deref_ref, recurse + 1, pretty);
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
- valaddr + embedded_offset),
- NULL);
+ valaddr + embedded_offset));
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val),
0,
case TYPE_CODE_METHOD:
{
- struct value *v = value_at (type, address, NULL);
+ struct value *v = value_at (type, address);
cp_print_class_method (VALUE_CONTENTS (value_addr (v)),
lookup_pointer_type (type), stream);
break;
CORE_ADDR address = dwarf_expr_fetch (ctx, 0);
retval = allocate_value (SYMBOL_TYPE (var));
- VALUE_BFD_SECTION (retval) = SYMBOL_BFD_SECTION (var);
-
VALUE_LVAL (retval) = lval_memory;
VALUE_LAZY (retval) = 1;
VALUE_ADDRESS (retval) = address;
return value_zero (exp->elts[pc + 1].type, lval_memory);
else
return value_at_lazy (exp->elts[pc + 1].type,
- value_as_address (arg1),
- NULL);
+ value_as_address (arg1));
case UNOP_PREINCREMENT:
arg1 = evaluate_subexp (expect_type, exp, pos, noside);
its type; print the value in the type of the MEMVAL. */
(*pos) += 4;
val = value_at_lazy (exp->elts[pc + 1].type,
- (CORE_ADDR) exp->elts[pc + 5].longconst,
- NULL);
+ (CORE_ADDR) exp->elts[pc + 5].longconst);
value_print (val, stream, 0, Val_no_prettyprint);
}
else
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
- valaddr + embedded_offset),
- NULL);
+ valaddr + embedded_offset));
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val),
0,
v = allocate_value (type);
VALUE_LVAL (v) = lval_memory; /* The most likely possibility. */
- VALUE_BFD_SECTION (v) = SYMBOL_BFD_SECTION (var);
len = TYPE_LENGTH (type);
addresses have not been bound by the dynamic loader. Try again when executable is running.");
locaddr = SYMBOL_VALUE_ADDRESS (var);
- loc = value_at (lookup_pointer_type (type), locaddr, NULL);
+ loc = value_at (lookup_pointer_type (type), locaddr);
addr = value_as_address (loc);
}
if (!argref)
return 0;
argref += SYMBOL_VALUE (var);
- ref = value_at (lookup_pointer_type (type), argref, NULL);
+ ref = value_at (lookup_pointer_type (type), argref);
addr = value_as_address (ref);
break;
}
addr = VALUE_ADDRESS (lazy_value);
val = value_from_pointer (lookup_pointer_type (type), addr);
- VALUE_BFD_SECTION (val) = VALUE_BFD_SECTION (lazy_value);
return val;
}
vtable_address
= value_as_address (value_field (value, TYPE_VPTR_FIELDNO (value_type)));
vtable = value_at_lazy (vtable_type,
- vtable_address - vtable_address_point_offset (),
- VALUE_BFD_SECTION (value));
+ vtable_address - vtable_address_point_offset ());
/* Find the linker symbol for this vtable. */
vtable_symbol
= value_as_address (value_field (value, TYPE_VPTR_FIELDNO (vfn_base)));
vtable = value_at_lazy (vtable_type,
- vtable_address - vtable_address_point_offset (),
- VALUE_BFD_SECTION (value));
+ vtable_address - vtable_address_point_offset ());
/* Fetch the appropriate function pointer from the vtable. */
vfn = value_subscript (value_field (vtable, vtable_field_virtual_functions),
TYPE_NAME (vbasetype) ? TYPE_NAME (vbasetype) : "<unknown>");
vtable_address = value_as_address (value_at_lazy (builtin_type_void_data_ptr,
- address, NULL));
+ address));
vtable = value_at_lazy (vtable_type,
- vtable_address - vtable_address_point_offset (),
- NULL);
+ vtable_address - vtable_address_point_offset ());
offset_val = value_from_longest(builtin_type_int, cur_base_offset);
vbase_array = value_field (vtable, vtable_field_vcall_and_vbase_offsets);
base_offset = value_as_long (value_subscript (vbase_array, offset_val));
* which case the multiplier should be 8 and values should be long */
vp = value_at (builtin_type_int,
coreptr + 4 * (TYPE_FN_FIELD_VOFFSET (f, j) +
- HP_ACC_VFUNC_START), NULL);
+ HP_ACC_VFUNC_START));
coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
/* coreptr now contains the address of the virtual function */
/* pai: FIXME 32x64 problem here, if words are 8 bytes long
* the multiplier below has to be 8 and value should be long. */
vp = value_at (builtin_type_int,
- coreptr + 4 * (HP_ACC_VFUNC_START + class_index), NULL);
+ coreptr + 4 * (HP_ACC_VFUNC_START + class_index));
/* Indirect once more, offset by function index */
/* pai: FIXME 32x64 problem here, again multiplier could be 8 and value long */
coreptr =
*(CORE_ADDR *) (VALUE_CONTENTS (vp) +
4 * TYPE_FN_FIELD_VOFFSET (f, j));
- vp = value_at (builtin_type_int, coreptr, NULL);
+ vp = value_at (builtin_type_int, coreptr);
coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
/* coreptr now contains the address of the virtual function */
/* Fetch the top offset of the object */
/* FIXME possible 32x64 problem with pointer size & arithmetic */
vp = value_at (builtin_type_int,
- coreptr + 4 * HP_ACC_TOP_OFFSET_OFFSET,
- VALUE_BFD_SECTION (v));
+ coreptr + 4 * HP_ACC_TOP_OFFSET_OFFSET);
top_offset = value_as_long (vp);
if (top)
*top = top_offset;
/* Fetch the typeinfo pointer */
/* FIXME possible 32x64 problem with pointer size & arithmetic */
- vp = value_at (builtin_type_int, coreptr + 4 * HP_ACC_TYPEINFO_OFFSET,
- VALUE_BFD_SECTION (v));
+ vp = value_at (builtin_type_int, coreptr + 4 * HP_ACC_TYPEINFO_OFFSET);
/* Indirect through the typeinfo pointer and retrieve the pointer
* to the string name */
coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
error ("Retrieved null typeinfo pointer in trying to determine "
"run-time type");
/* 4 -> offset of name field */
- vp = value_at (builtin_type_int, coreptr + 4, VALUE_BFD_SECTION (v));
+ vp = value_at (builtin_type_int, coreptr + 4);
/* FIXME possible 32x64 problem */
coreptr = *(CORE_ADDR *) (VALUE_CONTENTS (vp));
you're seeing problems with values being returned using the
"struct return convention", check that PUSH_DUMMY_CALL isn't
playing tricks. */
- retval = value_at (value_type, struct_addr, NULL);
+ retval = value_at (value_type, struct_addr);
else
{
/* This code only handles "register convention". */
if (TYPE_CODE (VALUE_TYPE (obj_val)) == TYPE_CODE_PTR
&& TYPE_LENGTH (TYPE_TARGET_TYPE (VALUE_TYPE (obj_val))) == 0)
obj_val = value_at (get_java_object_type (),
- value_as_address (obj_val), NULL);
+ value_as_address (obj_val));
vtable_val = value_struct_elt (&obj_val, NULL, "vtable", NULL, "structure");
return value_struct_elt (&vtable_val, NULL, "class", NULL, "structure");
error ("array index (%ld) out of bounds (length: %ld)",
index, length);
address = (address + 4) + index * TYPE_LENGTH (el_type);
- return value_at (el_type, address, NULL);
+ return value_at (el_type, address);
}
else if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
type = type_from_class (java_class_from_object (val));
type = lookup_pointer_type (type);
- val = value_at (type, address, NULL);
+ val = value_at (type, address);
}
}
{
wtype = TYPE_TARGET_TYPE (type);
}
- vt_val = value_at (wtype, vt_address, NULL);
+ vt_val = value_at (wtype, vt_address);
val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val), 0,
VALUE_ADDRESS (vt_val), stream, format,
deref_ref, recurse + 1, pretty);
value_at
(TYPE_TARGET_TYPE (type),
unpack_pointer (lookup_pointer_type (builtin_type_void),
- valaddr + embedded_offset),
- NULL);
+ valaddr + embedded_offset));
val_print (VALUE_TYPE (deref_val),
VALUE_CONTENTS (deref_val), 0,
VALUE_ADDRESS (deref_val), stream, format,
static CORE_ADDR next_address;
-/* Default section to examine next. */
-
-static asection *next_section;
-
/* Last address examined. */
static CORE_ADDR last_examine_address;
static void validate_format (struct format_data, char *);
-static void do_examine (struct format_data, CORE_ADDR addr,
- asection * section);
-
static void print_formatted (struct value *, int, int, struct ui_file *);
static struct format_data decode_format (char **, int, int);
if (VALUE_LVAL (val) == lval_memory)
{
next_address = VALUE_ADDRESS (val) + len;
- next_section = VALUE_BFD_SECTION (val);
}
switch (format)
/* FIXME: Need to handle wchar_t's here... */
next_address = VALUE_ADDRESS (val)
+ val_print_string (VALUE_ADDRESS (val), -1, 1, stream);
- next_section = VALUE_BFD_SECTION (val);
break;
case 'i':
wrap_here (" ");
next_address = VALUE_ADDRESS (val)
+ gdb_print_insn (VALUE_ADDRESS (val), stream);
- next_section = VALUE_BFD_SECTION (val);
break;
default:
Fetch it from memory and print on gdb_stdout. */
static void
-do_examine (struct format_data fmt, CORE_ADDR addr, asection *sect)
+do_examine (struct format_data fmt, CORE_ADDR addr)
{
char format = 0;
char size;
size = fmt.size;
count = fmt.count;
next_address = addr;
- next_section = sect;
/* String or instruction format implies fetch single bytes
regardless of the specified size. */
the disassembler be modified so that LAST_EXAMINE_VALUE
is left with the byte sequence from the last complete
instruction fetched from memory? */
- last_examine_value = value_at_lazy (val_type, next_address, sect);
+ last_examine_value = value_at_lazy (val_type, next_address);
if (last_examine_value)
release_value (last_examine_value);
next_address = VALUE_ADDRESS (val);
else
next_address = value_as_address (val);
- if (VALUE_BFD_SECTION (val))
- next_section = VALUE_BFD_SECTION (val);
do_cleanups (old_chain);
}
- do_examine (fmt, next_address, next_section);
+ do_examine (fmt, next_address);
/* If the examine succeeds, we remember its size and format for next time. */
last_size = fmt.size;
annotate_display_value ();
- do_examine (d->format, addr, VALUE_BFD_SECTION (val));
+ do_examine (d->format, addr);
}
else
{
retval = value_from_pointer (valptrtype,
value_as_address (valptr)
+ (sz * value_as_long (valint)));
- VALUE_BFD_SECTION (retval) = VALUE_BFD_SECTION (valptr);
return retval;
}
return arg2;
}
else if (VALUE_LVAL (arg2) == lval_memory)
- {
- return value_at_lazy (type, VALUE_ADDRESS (arg2) + VALUE_OFFSET (arg2),
- VALUE_BFD_SECTION (arg2));
- }
+ return value_at_lazy (type, VALUE_ADDRESS (arg2) + VALUE_OFFSET (arg2));
else if (code1 == TYPE_CODE_VOID)
{
return value_zero (builtin_type_void, not_lval);
adjustments before or after calling it. */
struct value *
-value_at (struct type *type, CORE_ADDR addr, asection *sect)
+value_at (struct type *type, CORE_ADDR addr)
{
struct value *val;
VALUE_LVAL (val) = lval_memory;
VALUE_ADDRESS (val) = addr;
- VALUE_BFD_SECTION (val) = sect;
return val;
}
/* Return a lazy value with type TYPE located at ADDR (cf. value_at). */
struct value *
-value_at_lazy (struct type *type, CORE_ADDR addr, asection *sect)
+value_at_lazy (struct type *type, CORE_ADDR addr)
{
struct value *val;
VALUE_LVAL (val) = lval_memory;
VALUE_ADDRESS (val) = addr;
VALUE_LAZY (val) = 1;
- VALUE_BFD_SECTION (val) = sect;
return val;
}
retval = value_from_pointer (lookup_pointer_type (VALUE_TYPE (arg1)),
(VALUE_ADDRESS (arg1) + VALUE_OFFSET (arg1)));
- VALUE_BFD_SECTION (retval) = VALUE_BFD_SECTION (arg1);
return retval;
}
arg2 = value_change_enclosing_type (arg2, lookup_pointer_type (VALUE_ENCLOSING_TYPE (arg1)));
/* ... and also the relative position of the subobject in the full object */
VALUE_POINTED_TO_OFFSET (arg2) = VALUE_EMBEDDED_OFFSET (arg1);
- VALUE_BFD_SECTION (arg2) = VALUE_BFD_SECTION (arg1);
return arg2;
}
BUILTIN_TYPE_LONGEST would seem to be a mistake. */
if (TYPE_CODE (base_type) == TYPE_CODE_INT)
return value_at_lazy (builtin_type_int,
- (CORE_ADDR) value_as_long (arg1),
- VALUE_BFD_SECTION (arg1));
+ (CORE_ADDR) value_as_long (arg1));
else if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
{
struct type *enc_type;
enc_type = check_typedef (VALUE_ENCLOSING_TYPE (arg1));
enc_type = TYPE_TARGET_TYPE (enc_type);
/* Retrieve the enclosing object pointed to */
- arg2 = value_at_lazy (enc_type,
- value_as_address (arg1) - VALUE_POINTED_TO_OFFSET (arg1),
- VALUE_BFD_SECTION (arg1));
+ arg2 = value_at_lazy (enc_type, (value_as_address (arg1)
+ - VALUE_POINTED_TO_OFFSET (arg1)));
/* Re-adjust type */
VALUE_TYPE (arg2) = TYPE_TARGET_TYPE (base_type);
/* Add embedding info */
VALUE_CONTENTS_ALL (elemvec[idx]),
typelength);
}
- VALUE_BFD_SECTION (val) = VALUE_BFD_SECTION (elemvec[0]);
return val;
}
/* Create the array type and set up an array value to be evaluated lazily. */
- val = value_at_lazy (arraytype, addr, VALUE_BFD_SECTION (elemvec[0]));
+ val = value_at_lazy (arraytype, addr);
return (val);
}
addr = allocate_space_in_inferior (len);
write_memory (addr, ptr, len);
- val = value_at_lazy (stringtype, addr, NULL);
+ val = value_at_lazy (stringtype, addr);
return (val);
}
& use long type */
/* epstein : FIXME -- added param for overlay section. May not be correct */
- vp = value_at (builtin_type_int, vtbl + 4 * (-skip - index - HP_ACC_VBASE_START), NULL);
+ vp = value_at (builtin_type_int, vtbl + 4 * (-skip - index - HP_ACC_VBASE_START));
boffset = value_as_long (vp);
*skip_p = -1;
*boffset_p = boffset;
adjusting for the embedded offset of argp if that's what value_rtti_type
used for its computation. */
new_val = value_at_lazy (real_type, VALUE_ADDRESS (argp) - top +
- (using_enc ? 0 : VALUE_EMBEDDED_OFFSET (argp)),
- VALUE_BFD_SECTION (argp));
+ (using_enc ? 0 : VALUE_EMBEDDED_OFFSET (argp)));
VALUE_TYPE (new_val) = VALUE_TYPE (argp);
VALUE_EMBEDDED_OFFSET (new_val) = using_enc ? top + VALUE_EMBEDDED_OFFSET (argp) : top;
return new_val;
actually exist in the program. */
char optimized_out;
- /* The BFD section associated with this value. */
- asection *bfd_section;
-
/* Actual contents of the value. For use of this value; setting
it uses the stuff above. Not valid if lazy is nonzero.
Target byte-order. We force it to be aligned properly for any
#define VALUE_OPTIMIZED_OUT(val) ((val)->optimized_out)
#define VALUE_EMBEDDED_OFFSET(val) ((val)->embedded_offset)
#define VALUE_POINTED_TO_OFFSET(val) ((val)->pointed_to_offset)
-#define VALUE_BFD_SECTION(val) ((val)->bfd_section)
/* Convert a REF to the object referenced. */
if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) \
arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), \
unpack_pointer (VALUE_TYPE (arg), \
- VALUE_CONTENTS (arg)), \
- VALUE_BFD_SECTION (arg)); \
+ VALUE_CONTENTS (arg))); \
} while (0)
/* If ARG is an array, convert it to a pointer.
extern struct value *value_from_double (struct type *type, DOUBLEST num);
extern struct value *value_from_string (char *string);
-extern struct value *value_at (struct type *type, CORE_ADDR addr,
- asection * sect);
-extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr,
- asection * sect);
+extern struct value *value_at (struct type *type, CORE_ADDR addr);
+extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr);
extern struct value *value_from_register (struct type *type, int regnum,
struct frame_info *frame);
VALUE_REGNO (val) = -1;
VALUE_LAZY (val) = 0;
VALUE_OPTIMIZED_OUT (val) = 0;
- VALUE_BFD_SECTION (val) = NULL;
VALUE_EMBEDDED_OFFSET (val) = 0;
VALUE_POINTED_TO_OFFSET (val) = 0;
val->modifiable = 1;
VALUE_OPTIMIZED_OUT (val) = VALUE_OPTIMIZED_OUT (arg);
VALUE_EMBEDDED_OFFSET (val) = VALUE_EMBEDDED_OFFSET (arg);
VALUE_POINTED_TO_OFFSET (val) = VALUE_POINTED_TO_OFFSET (arg);
- VALUE_BFD_SECTION (val) = VALUE_BFD_SECTION (arg);
val->modifiable = arg->modifiable;
if (!VALUE_LAZY (val))
{
if (TYPE_FIELD_STATIC_HAS_ADDR (type, fieldno))
{
retval = value_at (TYPE_FIELD_TYPE (type, fieldno),
- TYPE_FIELD_STATIC_PHYSADDR (type, fieldno),
- NULL);
+ TYPE_FIELD_STATIC_PHYSADDR (type, fieldno));
}
else
{
else
{
retval = value_at (TYPE_FIELD_TYPE (type, fieldno),
- SYMBOL_VALUE_ADDRESS (msym),
- SYMBOL_BFD_SECTION (msym));
+ SYMBOL_VALUE_ADDRESS (msym));
}
}
else