gdb: trivial changes to use array_view

Change a few relatively obvious spots using value contents to propagate
the use array_view a bit more.

Change-Id: I5338a60986f06d5969fec803d04f8423c9288a15
This commit is contained in:
Simon Marchi
2021-10-25 23:50:22 -04:00
parent 2a50938ab7
commit 46680d22de
5 changed files with 19 additions and 32 deletions

View File

@ -1317,9 +1317,8 @@ eval_op_rust_struct_anon (struct type *expect_type, struct expression *exp,
if (rust_enum_p (type))
{
gdb::array_view<const gdb_byte> view (value_contents (lhs).data (),
TYPE_LENGTH (type));
type = resolve_dynamic_type (type, view, value_address (lhs));
type = resolve_dynamic_type (type, value_contents (lhs),
value_address (lhs));
if (rust_empty_enum_p (type))
error (_("Cannot access field %d of empty enum %s"),
@ -1380,9 +1379,8 @@ eval_op_rust_structop (struct type *expect_type, struct expression *exp,
struct type *type = value_type (lhs);
if (type->code () == TYPE_CODE_STRUCT && rust_enum_p (type))
{
gdb::array_view<const gdb_byte> view (value_contents (lhs).data (),
TYPE_LENGTH (type));
type = resolve_dynamic_type (type, view, value_address (lhs));
type = resolve_dynamic_type (type, value_contents (lhs),
value_address (lhs));
if (rust_empty_enum_p (type))
error (_("Cannot access field %s of empty enum %s"),