" (invalid location kind)"));
pinfo.type = check_typedef (resolved_type->field (i).type ());
+ size_t offset = TYPE_FIELD_BITPOS (resolved_type, i) / TARGET_CHAR_BIT;
pinfo.valaddr = addr_stack->valaddr;
- pinfo.addr
- = (addr_stack->addr
- + (TYPE_FIELD_BITPOS (resolved_type, i) / TARGET_CHAR_BIT));
+ if (!pinfo.valaddr.empty ())
+ pinfo.valaddr = pinfo.valaddr.slice (offset);
+ pinfo.addr = addr_stack->addr + offset;
pinfo.next = addr_stack;
resolved_type->field (i).set_type
[string_to_regexp "$v2"] \
"python print second array element"
}
+
+ set av1 "(initial => 0, rest => (tag => unused, cval => 88 'X'))"
+ set av2 "(initial => 0, rest => (tag => object, ival => 88))"
+ set full "($av1, $av2)"
+
+ gdb_test "print another_array(1)" " = [string_to_regexp $av1]" \
+ "print first element of another_array"
+ gdb_test "print another_array(2)" " = [string_to_regexp $av2]" \
+ "print second element of another_array"
+ gdb_test "print another_array" " = [string_to_regexp $full]" \
+ "print another_array"
}
Objects : array (1 .. 2) of Payload_T;
+ type Another_Type (Tag : Tag_T := Unused) is
+ record
+ case Tag is
+ when Unused =>
+ CVal : Character;
+ when Object =>
+ IVal : Integer;
+ end case;
+ end record;
+
+ type Enclosing is record
+ Initial : Integer;
+ Rest : Another_Type;
+ end record;
+
+ Another_Array : array (1 .. 2) of Enclosing
+ := ((Initial => 0, Rest => (Tag => Unused, CVal => 'X')),
+ (Initial => 0, Rest => (Tag => Object, IVal => 88)));
+
begin
Objects (1) := (Tag => Object, Values => (others => 2));
Do_Nothing (Objects'Address); -- START
+ Do_Nothing (Another_Array'Address);
end P;