+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
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;
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;