aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2010-01-04 14:56:16 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2010-01-04 14:56:16 +0000
commitdcbf108f79b23f0092a6d3c7cfb13471172e865f (patch)
tree1c722e6065732020f706dd8d8a45fa4be99cecd3 /gdb/dwarf2loc.c
parent704e9165595fdc491ff1a9f467dc4d7a64c949fd (diff)
downloadgdb-dcbf108f79b23f0092a6d3c7cfb13471172e865f.zip
gdb-dcbf108f79b23f0092a6d3c7cfb13471172e865f.tar.gz
gdb-dcbf108f79b23f0092a6d3c7cfb13471172e865f.tar.bz2
* dwarf2loc.c (read_pieced_value): If a piece occupies part of
a register, assume the least-signficant part is used. (write_pieced_value): Likewise.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 726345c..6679d74 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -275,11 +275,17 @@ read_pieced_value (struct value *v)
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;
@@ -346,7 +352,15 @@ write_pieced_value (struct value *to, struct value *from)
{
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: