diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/ada-lang.c | 10 | ||||
-rw-r--r-- | gdb/value.c | 2 | ||||
-rw-r--r-- | gdb/value.h | 3 |
4 files changed, 15 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6470c99..5c66f99 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2021-02-09 Tom Tromey <tromey@adacore.com> + * ada-lang.c (coerce_unspec_val_to_type): Avoid making lazy + not_lval value. + * value.c (value_contents_copy_raw): Now static. + * value.h (value_contents_copy_raw): Don't declare. + +2021-02-09 Tom Tromey <tromey@adacore.com> + * gdbtypes.c (resolve_dynamic_struct): Handle structure with no fields. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 70296f9..416a45b 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -601,13 +601,17 @@ coerce_unspec_val_to_type (struct value *val, struct type *type) trying to allocate some memory for it. */ ada_ensure_varsize_limit (type); - if (value_lazy (val) - || TYPE_LENGTH (type) > TYPE_LENGTH (value_type (val))) + if (value_optimized_out (val)) + result = allocate_optimized_out_value (type); + else if (value_lazy (val) + /* Be careful not to make a lazy not_lval value. */ + || (VALUE_LVAL (val) != not_lval + && TYPE_LENGTH (type) > TYPE_LENGTH (value_type (val)))) result = allocate_value_lazy (type); else { result = allocate_value (type); - value_contents_copy_raw (result, 0, val, 0, TYPE_LENGTH (type)); + value_contents_copy (result, 0, val, 0, TYPE_LENGTH (type)); } set_value_component_location (result, val); set_value_bitsize (result, value_bitsize (val)); diff --git a/gdb/value.c b/gdb/value.c index 4135d5e..bddf9a4 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -1304,7 +1304,7 @@ value_ranges_copy_adjusted (struct value *dst, int dst_bit_offset, It is assumed the contents of DST in the [DST_OFFSET, DST_OFFSET+LENGTH) range are wholly available. */ -void +static void value_contents_copy_raw (struct value *dst, LONGEST dst_offset, struct value *src, LONGEST src_offset, LONGEST length) { diff --git a/gdb/value.h b/gdb/value.h index 39e94f4..60a831c 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -739,9 +739,6 @@ extern struct value *allocate_value_lazy (struct type *type); extern void value_contents_copy (struct value *dst, LONGEST dst_offset, struct value *src, LONGEST src_offset, LONGEST length); -extern void value_contents_copy_raw (struct value *dst, LONGEST dst_offset, - struct value *src, LONGEST src_offset, - LONGEST length); extern struct value *allocate_repeat_value (struct type *type, int count); |