From 39d37385568d667a2f5fab7e10adda5813a54467 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 14 Feb 2011 11:30:37 +0000 Subject: gdb/ * value.h (value_contents_copy, value_contents_copy_raw): Declare. * value.c (value_contents_copy_raw, value_contents_copy): New functions. (value_primitive_field): Use value_contents_copy_raw instead of memcpy. * valops.c (value_fetch_lazy): Use value_contents_copy instead of memcpy. (value_array, value_slice): Ditto. * valarith.c (value_subscripted_rvalue): Use value_contents_copy_raw instead of memcpy. gdb/testsuite/ * gdb.trace/unavailable.exp (gdb_collect_globals_test): Add new tests for building arrays from unavailable values, subscripting non-memory rvalue unvailable arrays, and accessing fields or baseclasses of non-lazy unavailable values, * gdb.trace/unavailable.cc (small_struct, small_struct_b): New struct types. (g_smallstruct, g_smallstruct_b): New globals. --- gdb/valarith.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gdb/valarith.c') diff --git a/gdb/valarith.c b/gdb/valarith.c index 265532c..787fc69 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -210,8 +210,9 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) else { v = allocate_value (elt_type); - memcpy (value_contents_writeable (v), - value_contents (array) + elt_offs, elt_size); + value_contents_copy (v, value_embedded_offset (v), + array, value_embedded_offset (array) + elt_offs, + elt_size); } set_value_component_location (v, array); -- cgit v1.1