diff options
author | Tom Tromey <tom@tromey.com> | 2023-01-31 13:45:40 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-02-13 15:21:08 -0700 |
commit | bbe912ba8898f5440028a35d0a206d70a6877ed6 (patch) | |
tree | 0ffc199020a35bd2968ce1a69d3686737eca7933 /gdb/eval.c | |
parent | ee7bb2944b75ce482dbf3bdb2d396efc98f1cf89 (diff) | |
download | gdb-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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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; |