* gdb.texinfo (Omissions from Ada): Document that there is now

limited aggregate support.
This commit is contained in:
Paul N. Hilfinger 2006-01-02 09:47:18 +00:00
parent 52ce64369c
commit 860701dc69
2 changed files with 51 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2006-01-02 Paul N. Hilfinger <hilfinger@gnat.com>
* gdb.texinfo (Omissions from Ada): Document that there is now
limited aggregate support.
2005-12-28 Eli Zaretskii <eliz@gnu.org>
* gdb.texinfo (Registers): Describe how to refer to SSE and MMX

View File

@ -9812,7 +9812,52 @@ The other component-by-component array operations (@code{and}, @code{or},
are not implemented.
@item
There are no record or array aggregates.
@cindex array aggregates (Ada)
@cindex record aggregates (Ada)
@cindex aggregates (Ada)
There is limited support for array and record aggregates. They are
permitted only on the right sides of assignments, as in these examples:
@smallexample
set An_Array := (1, 2, 3, 4, 5, 6)
set An_Array := (1, others => 0)
set An_Array := (0|4 => 1, 1..3 => 2, 5 => 6)
set A_2D_Array := ((1, 2, 3), (4, 5, 6), (7, 8, 9))
set A_Record := (1, "Peter", True);
set A_Record := (Name => "Peter", Id => 1, Alive => True)
@end smallexample
Changing a
discriminant's value by assigning an aggregate has an
undefined effect if that discriminant is used within the record.
However, you can first modify discriminants by directly assigning to
them (which normally would not be allowed in Ada), and then performing an
aggregate assignment. For example, given a variable @code{A_Rec}
declared to have a type such as:
@smallexample
type Rec (Len : Small_Integer := 0) is record
Id : Integer;
Vals : IntArray (1 .. Len);
end record;
@end smallexample
you can assign a value with a different size of @code{Vals} with two
assignments:
@smallexample
set A_Rec.Len := 4
set A_Rec := (Id => 42, Vals => (1, 2, 3, 4))
@end smallexample
As this example also illustrates, @value{GDBN} is very loose about the usual
rules concerning aggregates. You may leave out some of the
components of an array or record aggregate (such as the @code{Len}
component in the assignment to @code{A_Rec} above); they will retain their
original values upon assignment. You may freely use dynamic values as
indices in component associations. You may even use overlapping or
redundant component associations, although which component values are
assigned in such cases is not defined.
@item
Calls to dispatching subprograms are not implemented.