* dwarf2loc.c (struct piece_closure): Remove ARCH member,
add ADDR_SIZE member. (allocate_piece_closure): Update. (copy_pieced_value_closure): Likewise. (dwarf2_evaluate_loc_desc): Likewise. (read_pieced_value): Use DWARF address size instead of GDB's gdbarch_addr_bit as size of values on the DWARF stack.
This commit is contained in:
parent
9445af9a0e
commit
6063c216d5
2 changed files with 22 additions and 12 deletions
|
@ -1,3 +1,13 @@
|
||||||
|
2010-02-26 Ulrich Weigand <uweigand@de.ibm.com>
|
||||||
|
|
||||||
|
* dwarf2loc.c (struct piece_closure): Remove ARCH member,
|
||||||
|
add ADDR_SIZE member.
|
||||||
|
(allocate_piece_closure): Update.
|
||||||
|
(copy_pieced_value_closure): Likewise.
|
||||||
|
(dwarf2_evaluate_loc_desc): Likewise.
|
||||||
|
(read_pieced_value): Use DWARF address size instead of
|
||||||
|
GDB's gdbarch_addr_bit as size of values on the DWARF stack.
|
||||||
|
|
||||||
2010-02-26 Phil Muldoon <pmuldoon@redhat.com>
|
2010-02-26 Phil Muldoon <pmuldoon@redhat.com>
|
||||||
Tom Tromey <tromey@redhat.com>
|
Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
|
|
@ -232,8 +232,8 @@ struct piece_closure
|
||||||
/* The number of pieces used to describe this variable. */
|
/* The number of pieces used to describe this variable. */
|
||||||
int n_pieces;
|
int n_pieces;
|
||||||
|
|
||||||
/* The architecture, used only for DWARF_VALUE_STACK. */
|
/* The target address size, used only for DWARF_VALUE_STACK. */
|
||||||
struct gdbarch *arch;
|
int addr_size;
|
||||||
|
|
||||||
/* The pieces themselves. */
|
/* The pieces themselves. */
|
||||||
struct dwarf_expr_piece *pieces;
|
struct dwarf_expr_piece *pieces;
|
||||||
|
@ -244,12 +244,12 @@ struct piece_closure
|
||||||
|
|
||||||
static struct piece_closure *
|
static struct piece_closure *
|
||||||
allocate_piece_closure (int n_pieces, struct dwarf_expr_piece *pieces,
|
allocate_piece_closure (int n_pieces, struct dwarf_expr_piece *pieces,
|
||||||
struct gdbarch *arch)
|
int addr_size)
|
||||||
{
|
{
|
||||||
struct piece_closure *c = XZALLOC (struct piece_closure);
|
struct piece_closure *c = XZALLOC (struct piece_closure);
|
||||||
|
|
||||||
c->n_pieces = n_pieces;
|
c->n_pieces = n_pieces;
|
||||||
c->arch = arch;
|
c->addr_size = addr_size;
|
||||||
c->pieces = XCALLOC (n_pieces, struct dwarf_expr_piece);
|
c->pieces = XCALLOC (n_pieces, struct dwarf_expr_piece);
|
||||||
|
|
||||||
memcpy (c->pieces, pieces, n_pieces * sizeof (struct dwarf_expr_piece));
|
memcpy (c->pieces, pieces, n_pieces * sizeof (struct dwarf_expr_piece));
|
||||||
|
@ -298,13 +298,12 @@ read_pieced_value (struct value *v)
|
||||||
|
|
||||||
case DWARF_VALUE_STACK:
|
case DWARF_VALUE_STACK:
|
||||||
{
|
{
|
||||||
size_t n;
|
struct gdbarch *gdbarch = get_type_arch (value_type (v));
|
||||||
int addr_size = gdbarch_addr_bit (c->arch) / 8;
|
size_t n = p->size;
|
||||||
n = p->size;
|
if (n > c->addr_size)
|
||||||
if (n > addr_size)
|
n = c->addr_size;
|
||||||
n = addr_size;
|
|
||||||
store_unsigned_integer (contents + offset, n,
|
store_unsigned_integer (contents + offset, n,
|
||||||
gdbarch_byte_order (c->arch),
|
gdbarch_byte_order (gdbarch),
|
||||||
p->v.expr.value);
|
p->v.expr.value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -377,7 +376,7 @@ copy_pieced_value_closure (struct value *v)
|
||||||
{
|
{
|
||||||
struct piece_closure *c = (struct piece_closure *) value_computed_closure (v);
|
struct piece_closure *c = (struct piece_closure *) value_computed_closure (v);
|
||||||
|
|
||||||
return allocate_piece_closure (c->n_pieces, c->pieces, c->arch);
|
return allocate_piece_closure (c->n_pieces, c->pieces, c->addr_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -439,7 +438,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame,
|
||||||
struct piece_closure *c;
|
struct piece_closure *c;
|
||||||
struct frame_id frame_id = get_frame_id (frame);
|
struct frame_id frame_id = get_frame_id (frame);
|
||||||
|
|
||||||
c = allocate_piece_closure (ctx->num_pieces, ctx->pieces, ctx->gdbarch);
|
c = allocate_piece_closure (ctx->num_pieces, ctx->pieces,
|
||||||
|
ctx->addr_size);
|
||||||
retval = allocate_computed_value (SYMBOL_TYPE (var),
|
retval = allocate_computed_value (SYMBOL_TYPE (var),
|
||||||
&pieced_value_funcs,
|
&pieced_value_funcs,
|
||||||
c);
|
c);
|
||||||
|
|
Loading…
Add table
Reference in a new issue