aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-01-31 09:38:22 -0700
committerTom Tromey <tom@tromey.com>2023-02-13 15:21:07 -0700
commitf49d5fa263e834a4cf171f43a450ac5b1ae5ae30 (patch)
tree937e4b0def781a3ee6d6700e5ceeb7d86df23bed /gdb/value.c
parentf9ee742cd7f9ea4f6050599a4784cb162dcc49b5 (diff)
downloadbinutils-f49d5fa263e834a4cf171f43a450ac5b1ae5ae30.zip
binutils-f49d5fa263e834a4cf171f43a450ac5b1ae5ae30.tar.gz
binutils-f49d5fa263e834a4cf171f43a450ac5b1ae5ae30.tar.bz2
Turn value_bitsize into method
This changes value_bitsize 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.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 8eb3cb2..2cdbd7e 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1046,17 +1046,6 @@ set_value_bitpos (struct value *value, LONGEST bit)
value->m_bitpos = bit;
}
-LONGEST
-value_bitsize (const struct value *value)
-{
- return value->m_bitsize;
-}
-void
-set_value_bitsize (struct value *value, LONGEST bit)
-{
- value->m_bitsize = bit;
-}
-
struct value *
value_parent (const struct value *value)
{
@@ -3940,7 +3929,7 @@ value_initialized (const struct value *val)
static void
value_fetch_lazy_bitfield (struct value *val)
{
- gdb_assert (value_bitsize (val) != 0);
+ gdb_assert (val->bitsize () != 0);
/* To read a lazy bitfield, read the entire enclosing value. This
prevents reading the same block of (possibly volatile) memory once
@@ -3952,7 +3941,7 @@ value_fetch_lazy_bitfield (struct value *val)
if (value_lazy (parent))
value_fetch_lazy (parent);
- unpack_value_bitfield (val, value_bitpos (val), value_bitsize (val),
+ unpack_value_bitfield (val, value_bitpos (val), val->bitsize (),
value_contents_for_printing (parent).data (),
value_offset (val), parent);
}
@@ -4126,7 +4115,7 @@ value_fetch_lazy (struct value *val)
{
/* Nothing. */
}
- else if (value_bitsize (val))
+ else if (val->bitsize ())
value_fetch_lazy_bitfield (val);
else if (VALUE_LVAL (val) == lval_memory)
value_fetch_lazy_memory (val);