From 181cebd4f8897990b94df2d979b16911d2281657 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sun, 9 Oct 2011 18:46:41 +0000 Subject: gdb/ Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches. * dwarf2-frame.c (execute_stack_op): Initialize ctx->ref_addr_size. * dwarf2expr.c (execute_stack_op) : Use ctx->ref_addr_size. Handle its invalid value. * dwarf2expr.h (struct dwarf_expr_context): New field ref_addr_size. * dwarf2loc.c (dwarf2_evaluate_loc_desc_full) (dwarf2_loc_desc_needs_frame): Initialize ctx->ref_addr_size. * dwarf2loc.h (dwarf2_per_cu_ref_addr_size): New declaration. * dwarf2read.c (decode_locdesc): Initialize ctx->ref_addr_size. (dwarf2_per_cu_ref_addr_size): New function. gdb/testsuite/ Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches. * gdb.dwarf2/implptr-64bit.S: New file. * gdb.dwarf2/implptr-64bit.exp: New file. --- gdb/dwarf2expr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'gdb/dwarf2expr.c') diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index 83c7db7f5d8..c2966070385 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -709,10 +709,14 @@ execute_stack_op (struct dwarf_expr_context *ctx, ULONGEST die; LONGEST len; + if (ctx->ref_addr_size == -1) + error (_("DWARF-2 expression error: DW_OP_GNU_implicit_pointer " + "is not allowed in frame context")); + /* The referred-to DIE. */ - ctx->len = extract_unsigned_integer (op_ptr, ctx->addr_size, + ctx->len = extract_unsigned_integer (op_ptr, ctx->ref_addr_size, byte_order); - op_ptr += ctx->addr_size; + op_ptr += ctx->ref_addr_size; /* The byte offset into the data. */ op_ptr = read_sleb128 (op_ptr, op_end, &len); -- cgit v1.2.1