aboutsummaryrefslogtreecommitdiff
path: root/gdb/rust-lang.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/rust-lang.c')
-rw-r--r--gdb/rust-lang.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
index 9123bf2..18dc6a5 100644
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
@@ -481,7 +481,8 @@ rust_print_enum (struct type *type, int embedded_offset,
}
const gdb_byte *valaddr = value_contents_for_printing (val);
- struct field *variant_field = rust_enum_variant (type, valaddr);
+ struct field *variant_field = rust_enum_variant (type,
+ valaddr + embedded_offset);
embedded_offset += FIELD_BITPOS (*variant_field) / 8;
struct type *variant_type = FIELD_TYPE (*variant_field);