From 46680d22de34be5057a1033eb489c1453e70eecc Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 25 Oct 2021 23:50:22 -0400 Subject: 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 --- gdb/rust-lang.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'gdb/rust-lang.c') diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index e5a4041..9ab8fbe 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -1317,9 +1317,8 @@ eval_op_rust_struct_anon (struct type *expect_type, struct expression *exp, if (rust_enum_p (type)) { - gdb::array_view 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 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"), -- cgit v1.1