aboutsummaryrefslogtreecommitdiff
path: root/gdb/ada-lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2009-05-28 00:53:52 +0000
committerTom Tromey <tromey@redhat.com>2009-05-28 00:53:52 +0000
commit42ae523077b469c09e83845d30ee137a844aacb8 (patch)
treef98cfedea6cf02b425bb1e5e0b64578bacda14c7 /gdb/ada-lang.c
parent2c74e8338149ee8a2c5effa422866d04aef73063 (diff)
downloadgdb-42ae523077b469c09e83845d30ee137a844aacb8.zip
gdb-42ae523077b469c09e83845d30ee137a844aacb8.tar.gz
gdb-42ae523077b469c09e83845d30ee137a844aacb8.tar.bz2
2009-05-27 Tom Tromey <tromey@redhat.com>
Paul Pluzhnikov <ppluzhnikov@google.com> * mi/mi-main.c (mi_cmd_data_evaluate_expression): Use value_address. * cli/cli-dump.c (dump_value_to_file): Use value_address. * valprint.c (common_val_print): Likewise. * v850-tdep.c (v850_push_dummy_call): Use value_address. * tracepoint.c (encode_actions): Use value_address. * printcmd.c (print_formatted): Use value_address. (x_command): Likewise. * p-valprint.c (pascal_object_print_static_field): Use value_address. * mn10300-tdep.c (mn10300_push_dummy_call): Use value_address. * mips-tdep.c (mips_eabi_push_dummy_call): Use value_address. * m32r-tdep.c (m32r_push_dummy_call): Use value_address. * jv-valprint.c (java_value_print): Use value_address. * infcall.c (find_function_addr): Use value_address. * gnu-v3-abi.c (gnuv3_rtti_type): Use value_address. * gnu-v2-abi.c (gnuv2_value_rtti_type): Use value_address. * frv-tdep.c (frv_push_dummy_call): Use value_address. * frame.c (frame_register_unwind): Use value_address. (frame_unwind_register_value): Likewise. * darwin-nat-info.c (info_mach_region_command): Use value_address. * cp-valprint.c (cp_print_static_field): Use value_address. * c-valprint.c (c_value_print): Use value_address. * breakpoint.c (update_watchpoint): Use value_address. (can_use_hardware_watchpoint): Likewise. * ada-valprint.c (ada_val_print_1): Use value_address. (ada_value_print): Likewise. * ada-tasks.c (read_fat_string_value): Use value_address. * jv-lang.c (java_link_class_type): Use set_value_address. (java_link_class_type): Likewise. (get_java_utf8_name): Use value_address. (type_from_class): Likewise. (java_link_class_type): Likewise. * findvar.c (value_of_register): Use set_value_address. (read_var_value): Likewise. (read_var_value): Likewise. * eval.c (evaluate_subexp_standard): Use set_value_address. (evaluate_subexp_standard): Use value_address. * dwarf2loc.c (dwarf2_evaluate_loc_desc): Use set_value_address. * ada-lang.c (coerce_unspec_val_to_type): Use set_value_address. (ada_value_primitive_packed_val): Likewise. (ensure_lval): Likewise. (thin_data_pntr): Use value_address. (desc_bounds): Likewise. (ada_value_primitive_packed_val): Likewise. (value_assign_to_component): Likewise. (ensure_lval): Likewise. (make_array_descriptor): Likewise. (ada_to_fixed_value): Likewise. (unwrap_value): Likewise. * value.c (deprecated_value_address_hack): Remove. (value_address): New function. (value_raw_address): Likewise. (set_value_address): Likewise. (value_fn_field): Use set_value_address. (value_from_contents_and_address): Likewise. (value_fn_field): Likewise. (allocate_value_lazy): Don't use VALUE_ADDRESS. (value_as_address): Use value_address. (value_static_field): Likewise. * valops.c (search_struct_field): Use set_value_address. (value_at): Likewise. (value_at_lazy): Likewise. (value_repeat): Likewise. (value_cast_structs): Use value_address. (value_cast): Likewise. (value_fetch_lazy): Likewise. (value_assign): Likewise. (value_repeat): Likewise. (address_of_variable): Likewise. (value_coerce_array): Likewise. (value_coerce_function): Likewise. (value_addr): Likewise. (search_struct_field): Likewise. (search_struct_method): Likewise. (find_method_list): Likewise. (value_struct_elt_for_reference): Likewise. (value_full_object): Likewise. * jv-valprint.c (java_value_print): Use set_value_address. * value.h (deprecated_value_address_hack): Remove. (VALUE_ADDRESS): Remove. (value_address): Declare. (value_raw_address): Declare. (set_value_address): Declare.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r--gdb/ada-lang.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 4a45a62..02c7821 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -485,7 +485,7 @@ coerce_unspec_val_to_type (struct value *val, struct type *type)
set_value_component_location (result, val);
set_value_bitsize (result, value_bitsize (val));
set_value_bitpos (result, value_bitpos (val));
- VALUE_ADDRESS (result) += value_offset (val);
+ set_value_address (result, value_address (val));
if (value_lazy (val)
|| TYPE_LENGTH (type) > TYPE_LENGTH (value_type (val)))
set_value_lazy (result, 1);
@@ -1287,8 +1287,7 @@ thin_data_pntr (struct value *val)
if (TYPE_CODE (type) == TYPE_CODE_PTR)
return value_cast (data_type, value_copy (val));
else
- return value_from_longest (data_type,
- VALUE_ADDRESS (val) + value_offset (val));
+ return value_from_longest (data_type, value_address (val));
}
/* True iff TYPE indicates a "thick" array pointer type. */
@@ -1353,7 +1352,7 @@ desc_bounds (struct value *arr)
if (TYPE_CODE (type) == TYPE_CODE_PTR)
addr = value_as_long (arr);
else
- addr = VALUE_ADDRESS (arr) + value_offset (arr);
+ addr = value_address (arr);
return
value_from_longest (lookup_pointer_type (bounds_type),
@@ -1968,9 +1967,9 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
else if (VALUE_LVAL (obj) == lval_memory && value_lazy (obj))
{
v = value_at (type,
- VALUE_ADDRESS (obj) + value_offset (obj) + offset);
+ value_address (obj) + offset);
bytes = (unsigned char *) alloca (len);
- read_memory (VALUE_ADDRESS (v), bytes, len);
+ read_memory (value_address (v), bytes, len);
}
else
{
@@ -1980,15 +1979,17 @@ ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr,
if (obj != NULL)
{
+ CORE_ADDR new_addr;
set_value_component_location (v, obj);
- VALUE_ADDRESS (v) += value_offset (obj) + offset;
+ new_addr = value_address (obj) + offset;
set_value_bitpos (v, bit_offset + value_bitpos (obj));
set_value_bitsize (v, bit_size);
if (value_bitpos (v) >= HOST_CHAR_BIT)
{
- VALUE_ADDRESS (v) += 1;
+ ++new_addr;
set_value_bitpos (v, value_bitpos (v) - HOST_CHAR_BIT);
}
+ set_value_address (v, new_addr);
}
else
set_value_bitsize (v, bit_size);
@@ -2181,7 +2182,7 @@ ada_value_assign (struct value *toval, struct value *fromval)
int from_size;
char *buffer = (char *) alloca (len);
struct value *val;
- CORE_ADDR to_addr = VALUE_ADDRESS (toval) + value_offset (toval);
+ CORE_ADDR to_addr = value_address (toval);
if (TYPE_CODE (type) == TYPE_CODE_FLT)
fromval = value_cast (type, fromval);
@@ -2222,8 +2223,7 @@ value_assign_to_component (struct value *container, struct value *component,
struct value *val)
{
LONGEST offset_in_container =
- (LONGEST) (VALUE_ADDRESS (component) + value_offset (component)
- - VALUE_ADDRESS (container) - value_offset (container));
+ (LONGEST) (value_address (component) - value_address (container));
int bit_offset_in_container =
value_bitpos (component) - value_bitpos (container);
int bits;
@@ -3750,7 +3750,7 @@ parse_old_style_renaming (struct type *type,
/* Return an lvalue containing the value VAL. This is the identity on
lvalues, and otherwise has the side-effect of pushing a copy of VAL
on the stack, using and updating *SP as the stack pointer, and
- returning an lvalue whose VALUE_ADDRESS points to the copy. */
+ returning an lvalue whose value_address points to the copy. */
static struct value *
ensure_lval (struct value *val, CORE_ADDR *sp)
@@ -3764,12 +3764,12 @@ ensure_lval (struct value *val, CORE_ADDR *sp)
indicated. */
if (gdbarch_inner_than (current_gdbarch, 1, 2))
{
- /* Stack grows downward. Align SP and VALUE_ADDRESS (val) after
+ /* Stack grows downward. Align SP and value_address (val) after
reserving sufficient space. */
*sp -= len;
if (gdbarch_frame_align_p (current_gdbarch))
*sp = gdbarch_frame_align (current_gdbarch, *sp);
- VALUE_ADDRESS (val) = *sp;
+ set_value_address (val, *sp);
}
else
{
@@ -3777,14 +3777,14 @@ ensure_lval (struct value *val, CORE_ADDR *sp)
then again, re-align the frame. */
if (gdbarch_frame_align_p (current_gdbarch))
*sp = gdbarch_frame_align (current_gdbarch, *sp);
- VALUE_ADDRESS (val) = *sp;
+ set_value_address (val, *sp);
*sp += len;
if (gdbarch_frame_align_p (current_gdbarch))
*sp = gdbarch_frame_align (current_gdbarch, *sp);
}
VALUE_LVAL (val) = lval_memory;
- write_memory (VALUE_ADDRESS (val), value_contents_raw (val), len);
+ write_memory (value_address (val), value_contents_raw (val), len);
}
return val;
@@ -3873,12 +3873,12 @@ make_array_descriptor (struct type *type, struct value *arr, CORE_ADDR *sp)
bounds = ensure_lval (bounds, sp);
modify_general_field (value_contents_writeable (descriptor),
- VALUE_ADDRESS (ensure_lval (arr, sp)),
+ value_address (ensure_lval (arr, sp)),
fat_pntr_data_bitpos (desc_type),
fat_pntr_data_bitsize (desc_type));
modify_general_field (value_contents_writeable (descriptor),
- VALUE_ADDRESS (bounds),
+ value_address (bounds),
fat_pntr_bounds_bitpos (desc_type),
fat_pntr_bounds_bitsize (desc_type));
@@ -7430,7 +7430,7 @@ static struct value *
ada_to_fixed_value (struct value *val)
{
return ada_to_fixed_value_create (value_type (val),
- VALUE_ADDRESS (val) + value_offset (val),
+ value_address (val),
val);
}
@@ -7776,7 +7776,7 @@ unwrap_value (struct value *val)
return
coerce_unspec_val_to_type
(val, ada_to_fixed_type (raw_real_type, 0,
- VALUE_ADDRESS (val) + value_offset (val),
+ value_address (val),
NULL, 1));
}
}