diff options
author | Tom Tromey <tromey@redhat.com> | 2010-02-23 16:14:36 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-02-23 16:14:36 +0000 |
commit | 05566b3b8548616bad5290963b097f1d30a2df9e (patch) | |
tree | 53f753e39c32b0221c2d44857e56604964f6dc10 | |
parent | a431bc2e60d7f1c992f17b7ba454f09f22dc32b5 (diff) | |
download | gdb-05566b3b8548616bad5290963b097f1d30a2df9e.zip gdb-05566b3b8548616bad5290963b097f1d30a2df9e.tar.gz gdb-05566b3b8548616bad5290963b097f1d30a2df9e.tar.bz2 |
* dwarf2loc.c (read_pieced_value) <DWARF_VALUE_STACK>: Correctly
handle big-endian values.
(dwarf2_evaluate_loc_desc) <DWARF_VALUE_STACK>: Likewise.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/dwarf2loc.c | 16 |
2 files changed, 12 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c82bf88..d5fd34e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2010-02-23 Tom Tromey <tromey@redhat.com> + + * dwarf2loc.c (read_pieced_value) <DWARF_VALUE_STACK>: Correctly + handle big-endian values. + (dwarf2_evaluate_loc_desc) <DWARF_VALUE_STACK>: Likewise. + 2010-02-22 Pedro Alves <pedro@codesourcery.com> PR9605 diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 6679d74..1c4d057 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -298,16 +298,14 @@ read_pieced_value (struct value *v) case DWARF_VALUE_STACK: { - gdb_byte bytes[sizeof (ULONGEST)]; size_t n; int addr_size = gdbarch_addr_bit (c->arch) / 8; - store_unsigned_integer (bytes, addr_size, - gdbarch_byte_order (c->arch), - p->v.expr.value); n = p->size; if (n > addr_size) n = addr_size; - memcpy (contents + offset, bytes, n); + store_unsigned_integer (contents + offset, n, + gdbarch_byte_order (c->arch), + p->v.expr.value); } break; @@ -476,19 +474,17 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, case DWARF_VALUE_STACK: { - gdb_byte bytes[sizeof (ULONGEST)]; ULONGEST value = (ULONGEST) dwarf_expr_fetch (ctx, 0); bfd_byte *contents; size_t n = ctx->addr_size; - store_unsigned_integer (bytes, ctx->addr_size, - gdbarch_byte_order (ctx->gdbarch), - value); retval = allocate_value (SYMBOL_TYPE (var)); contents = value_contents_raw (retval); if (n > TYPE_LENGTH (SYMBOL_TYPE (var))) n = TYPE_LENGTH (SYMBOL_TYPE (var)); - memcpy (contents, bytes, n); + store_unsigned_integer (contents, n, + gdbarch_byte_order (ctx->gdbarch), + value); } break; |