aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-31 09:56:33 -0700
committerTom Tromey <tom@tromey.com>2023-02-13 15:21:07 -0700
commitfac7bdaaab474e2741b88d24781facd9521d0e9c (patch)
tree0916d296348e4b31d3f716ce82023b9bd0ca6955 /gdb/value.c
parent5011c493fb54235b47fbd76e9734072995d93da8 (diff)
downloadbinutils-fac7bdaaab474e2741b88d24781facd9521d0e9c.zip
binutils-fac7bdaaab474e2741b88d24781facd9521d0e9c.tar.gz
binutils-fac7bdaaab474e2741b88d24781facd9521d0e9c.tar.bz2
Turn value_parent into method
This changes value_parent to be a method of value. Much of this patch was written by script. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/gdb/value.c b/gdb/value.c
index a51f5ad..2a53144 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1035,20 +1035,6 @@ set_value_offset (struct value *value, LONGEST offset)
value->m_offset = offset;
}
-struct value *
-value_parent (const struct value *value)
-{
- return value->m_parent.get ();
-}
-
-/* See value.h. */
-
-void
-set_value_parent (struct value *value, struct value *parent)
-{
- value->m_parent = value_ref_ptr::new_reference (parent);
-}
-
gdb::array_view<gdb_byte>
value_contents_raw (struct value *value)
{
@@ -3064,7 +3050,7 @@ value_primitive_field (struct value *arg1, LONGEST offset,
v->m_offset = (value_embedded_offset (arg1)
+ offset
+ (bitpos - v->m_bitpos) / 8);
- set_value_parent (v, arg1);
+ v->set_parent (arg1);
if (!value_lazy (arg1))
value_fetch_lazy (v);
}
@@ -3925,7 +3911,7 @@ value_fetch_lazy_bitfield (struct value *val)
per bitfield. It would be even better to read only the containing
word, but we have no way to record that just specific bits of a
value have been fetched. */
- struct value *parent = value_parent (val);
+ struct value *parent = val->parent ();
if (value_lazy (parent))
value_fetch_lazy (parent);