2005-02-07 Andrew Cagney <cagney@gnu.org>

* value.h (VALUE_LAZY): Delete
	(set_value_lazy): Declare.
	* value.c (set_value_lazy): Define.
	* valops.c, valarith.c, jv-valprint.c, jv-lang.c: Update.
	* gnu-v2-abi.c, findvar.c, dwarf2loc.c, ada-lang.c: Update.
This commit is contained in:
Andrew Cagney 2005-02-07 15:04:43 +00:00
parent 303e4c21e7
commit dfa52d88e7
11 changed files with 34 additions and 18 deletions

View file

@ -1,3 +1,11 @@
2005-02-07 Andrew Cagney <cagney@gnu.org>
* value.h (VALUE_LAZY): Delete
(set_value_lazy): Declare.
* value.c (set_value_lazy): Define.
* valops.c, valarith.c, jv-valprint.c, jv-lang.c: Update.
* gnu-v2-abi.c, findvar.c, dwarf2loc.c, ada-lang.c: Update.
2005-02-06 Andrew Cagney <cagney@gnu.org> 2005-02-06 Andrew Cagney <cagney@gnu.org>
* value.h (VALUE_OPTIMIZED_OUT): Delete. * value.h (VALUE_OPTIMIZED_OUT): Delete.

View file

@ -420,7 +420,7 @@ value_from_contents_and_address (struct type *type,
{ {
struct value *v = allocate_value (type); struct value *v = allocate_value (type);
if (valaddr == NULL) if (valaddr == NULL)
VALUE_LAZY (v) = 1; set_value_lazy (v, 1);
else else
memcpy (value_contents_raw (v), valaddr, TYPE_LENGTH (type)); memcpy (value_contents_raw (v), valaddr, TYPE_LENGTH (type));
VALUE_ADDRESS (v) = address; VALUE_ADDRESS (v) = address;
@ -453,7 +453,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
VALUE_ADDRESS (result) = VALUE_ADDRESS (val) + value_offset (val); VALUE_ADDRESS (result) = VALUE_ADDRESS (val) + value_offset (val);
if (value_lazy (val) if (value_lazy (val)
|| TYPE_LENGTH (type) > TYPE_LENGTH (value_type (val))) || TYPE_LENGTH (type) > TYPE_LENGTH (value_type (val)))
VALUE_LAZY (result) = 1; set_value_lazy (result, 1);
else else
memcpy (value_contents_raw (result), value_contents (val), memcpy (value_contents_raw (result), value_contents (val),
TYPE_LENGTH (type)); TYPE_LENGTH (type));

View file

@ -250,7 +250,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
retval = allocate_value (SYMBOL_TYPE (var)); retval = allocate_value (SYMBOL_TYPE (var));
VALUE_LVAL (retval) = lval_memory; VALUE_LVAL (retval) = lval_memory;
VALUE_LAZY (retval) = 1; set_value_lazy (retval, 1);
VALUE_ADDRESS (retval) = address; VALUE_ADDRESS (retval) = address;
} }

View file

@ -585,7 +585,7 @@ addresses have not been bound by the dynamic loader. Try again when executable i
} }
VALUE_ADDRESS (v) = addr; VALUE_ADDRESS (v) = addr;
VALUE_LAZY (v) = 1; set_value_lazy (v, 1);
return v; return v;
} }

View file

@ -166,7 +166,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
if (!value_lazy (arg1)) if (!value_lazy (arg1))
{ {
VALUE_LAZY (arg1) = 1; set_value_lazy (arg1, 1);
value_fetch_lazy (arg1); value_fetch_lazy (arg1);
} }

View file

@ -1,5 +1,7 @@
/* Java language support routines for GDB, the GNU debugger. /* Java language support routines for GDB, the GNU debugger.
Copyright 1997, 1998, 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
Copyright 1997, 1998, 1999, 2000, 2003, 2004, 2005 Free Software
Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -439,7 +441,7 @@ java_link_class_type (struct type *type, struct value *clas)
else else
{ /* Re-use field value for next field. */ { /* Re-use field value for next field. */
VALUE_ADDRESS (field) += TYPE_LENGTH (value_type (field)); VALUE_ADDRESS (field) += TYPE_LENGTH (value_type (field));
VALUE_LAZY (field) = 1; set_value_lazy (field, 1);
} }
temp = field; temp = field;
temp = value_struct_elt (&temp, NULL, "name", NULL, "structure"); temp = value_struct_elt (&temp, NULL, "name", NULL, "structure");
@ -509,7 +511,7 @@ java_link_class_type (struct type *type, struct value *clas)
else else
{ /* Re-use method value for next method. */ { /* Re-use method value for next method. */
VALUE_ADDRESS (method) += TYPE_LENGTH (value_type (method)); VALUE_ADDRESS (method) += TYPE_LENGTH (value_type (method));
VALUE_LAZY (method) = 1; set_value_lazy (method, 1);
} }
/* Get method name. */ /* Get method name. */

View file

@ -162,7 +162,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
} }
else else
{ {
VALUE_LAZY (v) = 1; set_value_lazy (v, 1);
v->offset = 0; v->offset = 0;
} }
@ -170,7 +170,7 @@ java_value_print (struct value *val, struct ui_file *stream, int format,
for (reps = 1; i + reps < length; reps++) for (reps = 1; i + reps < length; reps++)
{ {
VALUE_LAZY (next_v) = 1; set_value_lazy (next_v, 1);
next_v->offset += TYPE_LENGTH (el_type); next_v->offset += TYPE_LENGTH (el_type);
if (memcmp (value_contents (v), value_contents (next_v), if (memcmp (value_contents (v), value_contents (next_v),
TYPE_LENGTH (el_type)) != 0) TYPE_LENGTH (el_type)) != 0)

View file

@ -269,7 +269,7 @@ value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound
v = allocate_value (elt_type); v = allocate_value (elt_type);
if (value_lazy (array)) if (value_lazy (array))
VALUE_LAZY (v) = 1; set_value_lazy (v, 1);
else else
memcpy (value_contents_writeable (v), memcpy (value_contents_writeable (v),
value_contents (array) + elt_offs, elt_size); value_contents (array) + elt_offs, elt_size);

View file

@ -478,7 +478,7 @@ value_at_lazy (struct type *type, CORE_ADDR addr)
VALUE_LVAL (val) = lval_memory; VALUE_LVAL (val) = lval_memory;
VALUE_ADDRESS (val) = addr; VALUE_ADDRESS (val) = addr;
VALUE_LAZY (val) = 1; set_value_lazy (val, 1);
return val; return val;
} }
@ -506,7 +506,7 @@ value_fetch_lazy (struct value *val)
if (length) if (length)
read_memory (addr, value_contents_all_raw (val), length); read_memory (addr, value_contents_all_raw (val), length);
VALUE_LAZY (val) = 0; set_value_lazy (val, 0);
return 0; return 0;
} }
@ -1311,7 +1311,7 @@ search_struct_field (char *name, struct value *arg1, int offset,
VALUE_FRAME_ID (v2) = VALUE_FRAME_ID (arg1); VALUE_FRAME_ID (v2) = VALUE_FRAME_ID (arg1);
v2->offset = value_offset (arg1) + boffset; v2->offset = value_offset (arg1) + boffset;
if (value_lazy (arg1)) if (value_lazy (arg1))
VALUE_LAZY (v2) = 1; set_value_lazy (v2, 1);
else else
memcpy (value_contents_raw (v2), memcpy (value_contents_raw (v2),
value_contents_raw (arg1) + boffset, value_contents_raw (arg1) + boffset,
@ -2762,7 +2762,7 @@ value_slice (struct value *array, int lowbound, int length)
TYPE_CODE (slice_type) = TYPE_CODE (array_type); TYPE_CODE (slice_type) = TYPE_CODE (array_type);
slice = allocate_value (slice_type); slice = allocate_value (slice_type);
if (value_lazy (array)) if (value_lazy (array))
VALUE_LAZY (slice) = 1; set_value_lazy (slice, 1);
else else
memcpy (value_contents_writeable (slice), memcpy (value_contents_writeable (slice),
value_contents (array) + offset, value_contents (array) + offset,

View file

@ -179,6 +179,12 @@ value_lazy (struct value *value)
return value->lazy; return value->lazy;
} }
void
set_value_lazy (struct value *value, int val)
{
value->lazy = val;
}
const bfd_byte * const bfd_byte *
value_contents (struct value *value) value_contents (struct value *value)
{ {
@ -994,7 +1000,7 @@ value_primitive_field (struct value *arg1, int offset,
v = allocate_value (value_enclosing_type (arg1)); v = allocate_value (value_enclosing_type (arg1));
v->type = type; v->type = type;
if (value_lazy (arg1)) if (value_lazy (arg1))
VALUE_LAZY (v) = 1; set_value_lazy (v, 1);
else else
memcpy (value_contents_all_raw (v), value_contents_all_raw (arg1), memcpy (value_contents_all_raw (v), value_contents_all_raw (arg1),
TYPE_LENGTH (value_enclosing_type (arg1))); TYPE_LENGTH (value_enclosing_type (arg1)));
@ -1010,7 +1016,7 @@ value_primitive_field (struct value *arg1, int offset,
offset += TYPE_FIELD_BITPOS (arg_type, fieldno) / 8; offset += TYPE_FIELD_BITPOS (arg_type, fieldno) / 8;
v = allocate_value (type); v = allocate_value (type);
if (value_lazy (arg1)) if (value_lazy (arg1))
VALUE_LAZY (v) = 1; set_value_lazy (v, 1);
else else
memcpy (value_contents_raw (v), memcpy (value_contents_raw (v),
value_contents_raw (arg1) + offset, value_contents_raw (arg1) + offset,

View file

@ -180,7 +180,7 @@ extern int value_offset (struct value *);
extern struct type *value_enclosing_type (struct value *); extern struct type *value_enclosing_type (struct value *);
extern int value_lazy (struct value *); extern int value_lazy (struct value *);
#define VALUE_LAZY(val) (val)->lazy extern void set_value_lazy (struct value *value, int val);
/* value_contents() and value_contents_raw() both return the address /* value_contents() and value_contents_raw() both return the address
of the gdb buffer used to hold a copy of the contents of the lval. of the gdb buffer used to hold a copy of the contents of the lval.