From b6cdbc9a8173b9e6cc8cfc284caa0efa8129ca02 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 30 Jul 2022 12:01:12 -0400 Subject: gdb: add type::length / type::set_length Add the `length` and `set_length` methods on `struct type`, in order to remove the `TYPE_LENGTH` macro. In this patch, the macro is changed to use the getter, so all the call sites of the macro that are used as a setter are changed to use the setter method directly. The next patch will remove the macro completely. Change-Id: Id1090244f15c9856969b9be5006aefe8d8897ca4 --- gdb/rust-lang.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gdb/rust-lang.c') diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index 36f7790..a48996e 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -989,9 +989,8 @@ rust_composite_type (struct type *original, } if (i > 0) - TYPE_LENGTH (result) - = (result->field (i - 1).loc_bitpos () / TARGET_CHAR_BIT + - TYPE_LENGTH (result->field (i - 1).type ())); + result->set_length (result->field (i - 1).loc_bitpos () / TARGET_CHAR_BIT + + TYPE_LENGTH (result->field (i - 1).type ())); return result; } -- cgit v1.1