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/dwarf2 | |
parent | ee7bb2944b75ce482dbf3bdb2d396efc98f1cf89 (diff) | |
download | binutils-gdb-bbe912ba8898f5440028a35d0a206d70a6877ed6.tar.gz |
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/dwarf2')
-rw-r--r-- | gdb/dwarf2/expr.c | 6 | ||||
-rw-r--r-- | gdb/dwarf2/loc.c | 4 | ||||
-rw-r--r-- | gdb/dwarf2/read.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index bb77a969784..e08dca01a67 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -164,7 +164,7 @@ rw_pieced_value (value *v, value *from, bool check_optimized) if (check_optimized) v_contents = nullptr; else - v_contents = value_contents_raw (v).data (); + v_contents = v->contents_raw ().data (); from_contents = nullptr; } @@ -1026,7 +1026,7 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type, subobj_offset += n - max; copy (value_contents_all (val).slice (subobj_offset, len), - value_contents_raw (retval)); + retval->contents_raw ()); } break; @@ -1038,7 +1038,7 @@ dwarf_expr_context::fetch_result (struct type *type, struct type *subobj_type, invalid_synthetic_pointer (); retval = value::allocate (subobj_type); - bfd_byte *contents = value_contents_raw (retval).data (); + bfd_byte *contents = retval->contents_raw ().data (); memcpy (contents, this->m_data + subobj_offset, n); } break; diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 96686d9a110..0aa6aafe823 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -1363,8 +1363,8 @@ value_of_dwarf_reg_entry (struct type *type, frame_info_ptr frame, release_value (target_val).release ()); /* Copy the referencing pointer to the new computed value. */ - memcpy (value_contents_raw (val).data (), - value_contents_raw (outer_val).data (), + memcpy (val->contents_raw ().data (), + outer_val->contents_raw ().data (), checked_type->length ()); val->set_lazy (0); diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 754e6bedd4f..470ff125c5b 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -8992,7 +8992,7 @@ dwarf2_compute_name (const char *name, else if (bytes != NULL) { v = value::allocate (type); - memcpy (value_contents_writeable (v).data (), bytes, + memcpy (v->contents_writeable ().data (), bytes, type->length ()); } else |