+2019-05-01 Tom Tromey <tromey@adacore.com>
+
+ * ada-lang.c (ada_value_assign): Correctly compute starting offset
+ for big-endian copies.
+
2019-04-30 Ali Tamur <tamur@google.com>
* gdb/dwarf2read.c (read_3_bytes): New declaration.
(read_attribute_value): Added DW_FORM_strx1-4 cases.
from_size = value_bitsize (fromval);
if (from_size == 0)
from_size = TYPE_LENGTH (value_type (fromval)) * TARGET_CHAR_BIT;
- if (gdbarch_bits_big_endian (get_type_arch (type)))
- copy_bitwise (buffer, value_bitpos (toval),
- value_contents (fromval), from_size - bits, bits, 1);
- else
- copy_bitwise (buffer, value_bitpos (toval),
- value_contents (fromval), 0, bits, 0);
+
+ const int is_big_endian = gdbarch_bits_big_endian (get_type_arch (type));
+ ULONGEST from_offset = 0;
+ if (is_big_endian && is_scalar_type (value_type (fromval)))
+ from_offset = from_size - bits;
+ copy_bitwise (buffer, value_bitpos (toval),
+ value_contents (fromval), from_offset,
+ bits, is_big_endian);
write_memory_with_notification (to_addr, buffer, len);
val = value_copy (toval);
+2019-05-01 Tom Tromey <tromey@adacore.com>
+
+ * gdb.ada/packed_array_assign.exp: Add packed assignment
+ regression test.
+
2019-05-01 Tom de Vries <tdevries@suse.de>
* boards/cc-with-tweaks.exp: Generate gdb.sh, and pass it in env(GDB).
gdb_test \
"print pra := ((packed_array_assign_x => 2, packed_array_assign_y => 0, packed_array_assign_w => 17), pr, (packed_array_assign_x => 7, packed_array_assign_y => 1, packed_array_assign_w => 23))" \
" = \\(\\(packed_array_assign_w => 17, packed_array_assign_x => 2, packed_array_assign_y => 0\\), \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\), \\(packed_array_assign_w => 23, packed_array_assign_x => 7, packed_array_assign_y => 1\\)\\)"
+
+gdb_test "print pra(1) := pr" \
+ " = \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\)"
+gdb_test "print pra(1)" \
+ " = \\(packed_array_assign_w => 104, packed_array_assign_x => 2, packed_array_assign_y => 3\\)"