diff options
author | Tom Tromey <tromey@adacore.com> | 2021-03-15 06:23:12 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-03-15 06:23:12 -0600 |
commit | 207582c0758738447d2df8f778aeebf126c73b31 (patch) | |
tree | 986f9fbcef047e24e6742cb3f95e81102d4ec83d /gdb/ada-exp.h | |
parent | 1996d0f12cd57391e01e0eebe32e44510e6ec17d (diff) | |
download | gdb-207582c0758738447d2df8f778aeebf126c73b31.zip gdb-207582c0758738447d2df8f778aeebf126c73b31.tar.gz gdb-207582c0758738447d2df8f778aeebf126c73b31.tar.bz2 |
Fix bug in Ada aggregate assignment
The expression rewrite caused a regression in the internal AdaCore
test suite. The bug was that I had dropped a bit of code from
aggregate assignment -- assign_aggregate used to return the container,
which I thought was redundant, but which can actually change during
the call. There was no test for this case in the tree, so I've added
one.
gdb/ChangeLog
2021-03-15 Tom Tromey <tromey@adacore.com>
* ada-lang.c (ada_aggregate_operation::assign_aggregate): Return
container.
(ada_assign_operation::evaluate): Update.
* ada-exp.h (class ada_aggregate_operation) <assign_aggregate>:
Change return type.
gdb/testsuite/ChangeLog
2021-03-15 Tom Tromey <tromey@adacore.com>
* gdb.ada/assign_arr/target_wrapper.ads (IArray, Put, Do_Nothing):
Declare.
* gdb.ada/assign_arr/target_wrapper.adb: New file.
* gdb.ada/assign_arr/main_p324_051.adb (IValue): New variable.
Call Put.
* gdb.ada/assign_arr.exp: Update.
Diffstat (limited to 'gdb/ada-exp.h')
-rw-r--r-- | gdb/ada-exp.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index 0b6f1f2..82941dd 100644 --- a/gdb/ada-exp.h +++ b/gdb/ada-exp.h @@ -510,11 +510,12 @@ public: type, evaluate an assignment of this aggregate's value to LHS. CONTAINER is an lvalue containing LHS (possibly LHS itself). Does not modify the inferior's memory, nor does it modify the - contents of LHS (unless == CONTAINER). */ + contents of LHS (unless == CONTAINER). Returns the modified + CONTAINER. */ - void assign_aggregate (struct value *container, - struct value *lhs, - struct expression *exp); + value *assign_aggregate (struct value *container, + struct value *lhs, + struct expression *exp); value *evaluate (struct type *expect_type, struct expression *exp, |