aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-lang.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-10-25 23:50:22 -0400
committerSimon Marchi <simon.marchi@polymtl.ca>2021-12-03 16:42:02 -0500
commit46680d22de34be5057a1033eb489c1453e70eecc (patch)
treedb791e2bf4f581d656b2353f971c367be16263be /gdb/rust-lang.c
parent2a50938ab740296a1d6df67feea9401e57e4d90e (diff)
downloadgdb-46680d22de34be5057a1033eb489c1453e70eecc.zip
gdb-46680d22de34be5057a1033eb489c1453e70eecc.tar.gz
gdb-46680d22de34be5057a1033eb489c1453e70eecc.tar.bz2
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
Diffstat (limited to 'gdb/rust-lang.c')
-rw-r--r--gdb/rust-lang.c10
1 files changed, 4 insertions, 6 deletions
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<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"),