+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.
+
2021-03-15 Felix Willgerodt <felix.willgerodt@intel.com>
* i386-tdep.c (i386_floatformat_for_type): Add COMPLEX*32 and REAL*16.
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,
item->assign (container, lhs, exp, indices, low, high);
}
-/* Assuming that LHS represents an lvalue having a record or array
- 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). */
+/* See ada-exp.h. */
-void
+value *
ada_aggregate_operation::assign_aggregate (struct value *container,
struct value *lhs,
struct expression *exp)
std::get<0> (m_storage)->assign (container, lhs, exp, indices,
low_index, high_index);
+
+ return container;
}
bool
if (noside != EVAL_NORMAL)
return arg1;
- ag_op->assign_aggregate (arg1, arg1, exp);
+ arg1 = ag_op->assign_aggregate (arg1, arg1, exp);
return ada_value_assign (arg1, arg1);
}
/* Force the evaluation of the rhs ARG2 to the type of the lhs ARG1,
+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.
+
2021-03-15 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.python/py-auto-load-chaining-f1.c: New file.
gdb_test "print assign_arr_input.u2 :=(0.25, others => 0.125)" \
" = \\(0\\.25, 0\\.125, 0\\.125\\)"
+
+set line [gdb_get_line_number "STOP2" ${testdir}/target_wrapper.adb]
+gdb_breakpoint target_wrapper.adb:$line
+gdb_continue_to_breakpoint STOP2
+
+gdb_test "print a" " = \\(8, 10, 12\\)"
+gdb_test "print a := (2, 4, 6)" " = \\(2, 4, 6\\)" "assign to a"
with target_wrapper; use target_wrapper;
procedure Main_P324_051 is
+ IValue : IArray (1 .. 3) := (8, 10, 12);
begin
Assign_Arr_Input.u2 := (0.2,0.3,0.4); -- STOP
+ Put (IValue);
end Main_P324_051;
--- /dev/null
+-- Copyright 2021 Free Software Foundation, Inc.
+--
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+package body target_wrapper is
+
+ procedure Do_Nothing (A : System.Address) is
+ begin
+ null;
+ end Do_Nothing;
+
+ procedure Put (A : in out IArray) is
+ begin
+ Do_Nothing (A'Address); -- STOP2
+ end Put;
+
+end target_wrapper;
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
+with System;
+
package target_wrapper is
type Float_Array_3 is array (1 .. 3) of Float;
Assign_Arr_Input : parameters;
+ type IArray is array (Integer range <>) of Integer;
+
+ procedure Put (A : in out IArray);
+
+ procedure Do_Nothing (A : System.Address);
+
end target_wrapper;