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) <DW_OP_GNU_implicit_pointer>: 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.
This commit is contained in:
Jan Kratochvil
2011-10-09 18:46:41 +00:00
parent c471e7909f
commit 181cebd4f8
10 changed files with 302 additions and 2 deletions

View File

@ -14223,6 +14223,7 @@ decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
ctx->gdbarch = get_objfile_arch (objfile);
ctx->addr_size = cu->header.addr_size;
ctx->ref_addr_size = dwarf2_per_cu_ref_addr_size (cu->per_cu);
ctx->offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
ctx->baton = ctx;
ctx->funcs = &decode_locdesc_ctx_funcs;
@ -15313,6 +15314,22 @@ dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *per_cu)
return cu_headerp->offset_size;
}
/* See its dwarf2loc.h declaration. */
int
dwarf2_per_cu_ref_addr_size (struct dwarf2_per_cu_data *per_cu)
{
struct comp_unit_head cu_header_local;
const struct comp_unit_head *cu_headerp;
cu_headerp = per_cu_header_read_in (&cu_header_local, per_cu);
if (cu_headerp->version == 2)
return cu_headerp->addr_size;
else
return cu_headerp->offset_size;
}
/* Return the text offset of the CU. The returned offset comes from
this CU's objfile. If this objfile came from a separate debuginfo
file, then the offset may be different from the corresponding