+2010-01-04 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * dwarf2loc.c (read_pieced_value): If a piece occupies part of
+ a register, assume the least-signficant part is used.
+ (write_pieced_value): Likewise.
+
2010-01-04 Ulrich Weigand <uweigand@de.ibm.com>
* printcmd.c: Include "arch-utils.h".
case DWARF_VALUE_REGISTER:
{
struct gdbarch *arch = get_frame_arch (frame);
- bfd_byte regval[MAX_REGISTER_SIZE];
int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch,
p->v.expr.value);
- get_frame_register (frame, gdb_regnum, regval);
- memcpy (contents + offset, regval, p->size);
+ int reg_offset = 0;
+
+ if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG
+ && p->size < register_size (arch, gdb_regnum))
+ /* Big-endian, and we want less than full size. */
+ reg_offset = register_size (arch, gdb_regnum) - p->size;
+
+ get_frame_register_bytes (frame, gdb_regnum, reg_offset, p->size,
+ contents + offset);
}
break;
{
struct gdbarch *arch = get_frame_arch (frame);
int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (arch, p->v.expr.value);
- put_frame_register (frame, gdb_regnum, contents + offset);
+ int reg_offset = 0;
+
+ if (gdbarch_byte_order (arch) == BFD_ENDIAN_BIG
+ && p->size < register_size (arch, gdb_regnum))
+ /* Big-endian, and we want less than full size. */
+ reg_offset = register_size (arch, gdb_regnum) - p->size;
+
+ put_frame_register_bytes (frame, gdb_regnum, reg_offset, p->size,
+ contents + offset);
}
break;
case DWARF_VALUE_MEMORY: