Commit 3d78d293 by Mark Wielaard Committed by Mark Wielaard

re PR debug/40659 (A simple struct member offset doesn't need a full dwarf location expression)

2009-07-08  Mark Wielaard  <mjw@redhat.com>

	PR debug/40659
	* dwarf2out.c (add_data_member_location_attribute): When we have
	only a constant offset don't emit a new location description using
	DW_OP_plus_uconst, but just add the constant with add_AT_int, when
	dwarf_version > 2.

From-SVN: r149377
parent ac2e563f
2009-07-08 Mark Wielaard <mjw@redhat.com>
PR debug/40659
* dwarf2out.c (add_data_member_location_attribute): When we have
only a constant offset don't emit a new location description using
DW_OP_plus_uconst, but just add the constant with add_AT_int, when
dwarf_version > 2.
2009-07-08 Richard Henderson <rth@redhat.com> 2009-07-08 Richard Henderson <rth@redhat.com>
PR target/38900 PR target/38900
......
...@@ -11475,11 +11475,19 @@ add_data_member_location_attribute (dw_die_ref die, tree decl) ...@@ -11475,11 +11475,19 @@ add_data_member_location_attribute (dw_die_ref die, tree decl)
if (! loc_descr) if (! loc_descr)
{ {
if (dwarf_version > 2)
{
/* Don't need to output a location expression, just the constant. */
add_AT_int (die, DW_AT_data_member_location, offset);
return;
}
else
{
enum dwarf_location_atom op; enum dwarf_location_atom op;
/* The DWARF2 standard says that we should assume that the structure /* The DWARF2 standard says that we should assume that the structure
address is already on the stack, so we can specify a structure field address is already on the stack, so we can specify a structure
address by using DW_OP_plus_uconst. */ field address by using DW_OP_plus_uconst. */
#ifdef MIPS_DEBUGGING_INFO #ifdef MIPS_DEBUGGING_INFO
/* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst /* ??? The SGI dwarf reader does not handle the DW_OP_plus_uconst
...@@ -11492,6 +11500,7 @@ add_data_member_location_attribute (dw_die_ref die, tree decl) ...@@ -11492,6 +11500,7 @@ add_data_member_location_attribute (dw_die_ref die, tree decl)
loc_descr = new_loc_descr (op, offset, 0); loc_descr = new_loc_descr (op, offset, 0);
} }
}
add_AT_loc (die, DW_AT_data_member_location, loc_descr); add_AT_loc (die, DW_AT_data_member_location, loc_descr);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment