aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-31 13:45:40 -0700
committerTom Tromey <tom@tromey.com>2023-02-13 15:21:08 -0700
commitbbe912ba8898f5440028a35d0a206d70a6877ed6 (patch)
tree0ffc199020a35bd2968ce1a69d3686737eca7933 /gdb/eval.c
parentee7bb2944b75ce482dbf3bdb2d396efc98f1cf89 (diff)
downloadgdb-bbe912ba8898f5440028a35d0a206d70a6877ed6.zip
gdb-bbe912ba8898f5440028a35d0a206d70a6877ed6.tar.gz
gdb-bbe912ba8898f5440028a35d0a206d70a6877ed6.tar.bz2
Turn some value_contents functions into methods
This turns value_contents_raw, value_contents_writeable, and value_contents_all_raw into methods on value. The remaining functions will be changed later in the series; they were a bit trickier and so I didn't include them in this patch. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index 7dcad5b..fbc72a5 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -2413,7 +2413,7 @@ array_operation::evaluate_struct_tuple (struct value *struct_val,
bitsize = TYPE_FIELD_BITSIZE (struct_type, fieldno);
bitpos = struct_type->field (fieldno).loc_bitpos ();
- addr = value_contents_writeable (struct_val).data () + bitpos / 8;
+ addr = struct_val->contents_writeable ().data () + bitpos / 8;
if (bitsize)
modify_field (struct_type, addr,
value_as_long (val), bitpos % 8, bitsize);
@@ -2442,7 +2442,7 @@ array_operation::evaluate (struct type *expect_type,
{
struct value *rec = value::allocate (expect_type);
- memset (value_contents_raw (rec).data (), '\0', type->length ());
+ memset (rec->contents_raw ().data (), '\0', type->length ());
return evaluate_struct_tuple (rec, exp, noside, nargs);
}
@@ -2461,7 +2461,7 @@ array_operation::evaluate (struct type *expect_type,
high_bound = (type->length () / element_size) - 1;
}
index = low_bound;
- memset (value_contents_raw (array).data (), 0, expect_type->length ());
+ memset (array->contents_raw ().data (), 0, expect_type->length ());
for (tem = nargs; --nargs >= 0;)
{
struct value *element;
@@ -2473,7 +2473,7 @@ array_operation::evaluate (struct type *expect_type,
if (index > high_bound)
/* To avoid memory corruption. */
error (_("Too many array elements"));
- memcpy (value_contents_raw (array).data ()
+ memcpy (array->contents_raw ().data ()
+ (index - low_bound) * element_size,
value_contents (element).data (),
element_size);
@@ -2486,7 +2486,7 @@ array_operation::evaluate (struct type *expect_type,
&& type->code () == TYPE_CODE_SET)
{
struct value *set = value::allocate (expect_type);
- gdb_byte *valaddr = value_contents_raw (set).data ();
+ gdb_byte *valaddr = set->contents_raw ().data ();
struct type *element_type = type->index_type ();
struct type *check_type = element_type;
LONGEST low_bound, high_bound;