Turn remaining value_contents functions into methods

This turns the remaining value_contents functions -- value_contents,
value_contents_all, value_contents_for_printing, and
value_contents_for_printing_const -- into methods of value.  It also
converts the static functions require_not_optimized_out and
require_available to be private methods.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey
2023-01-31 14:38:30 -07:00
parent cdf3de175d
commit efaf1ae025
84 changed files with 330 additions and 329 deletions

View File

@ -714,7 +714,7 @@ infpy_thread_from_thread_handle (PyObject *self, PyObject *args, PyObject *kw)
else if (gdbpy_is_value_object (handle_obj))
{
struct value *val = value_object_to_value (handle_obj);
bytes = value_contents_all (val).data ();
bytes = val->contents_all ().data ();
bytes_len = val->type ()->length ();
}
else

View File

@ -131,7 +131,7 @@ pyuw_value_obj_to_pointer (PyObject *pyo_value, CORE_ADDR *addr)
if ((value = value_object_to_value (pyo_value)) != NULL)
{
*addr = unpack_pointer (value->type (),
value_contents (value).data ());
value->contents ().data ());
rc = 1;
}
}
@ -624,7 +624,7 @@ pyuw_sniffer (const struct frame_unwind *self, frame_info_ptr this_frame,
cached_frame->reg[i].data = (gdb_byte *) xmalloc (data_size);
memcpy (cached_frame->reg[i].data,
value_contents (value).data (), data_size);
value->contents ().data (), data_size);
}
}

View File

@ -1537,7 +1537,7 @@ valpy_nonzero (PyObject *self)
nonzero = !!value_as_long (self_value->value);
else if (is_floating_value (self_value->value))
nonzero = !target_float_is_zero
(value_contents (self_value->value).data (), type);
(self_value->value->contents ().data (), type);
else
/* All other values are True. */
nonzero = 1;
@ -1755,7 +1755,7 @@ valpy_float (PyObject *self)
type = check_typedef (type);
if (type->code () == TYPE_CODE_FLT && is_floating_value (value))
d = target_float_to_host_double (value_contents (value).data (), type);
d = target_float_to_host_double (value->contents ().data (), type);
else if (type->code () == TYPE_CODE_INT)
{
/* Note that valpy_long accepts TYPE_CODE_PTR and some