Commit eef25142 by James E Wilson Committed by Jim Wilson

Restore old AT_frame_base code for targets that don't use dwarf2 unwind info.

Partial fix.
PR debug/24444
* dwarf2out.c (convert_cfa_to_loc_list): Put inside DWARF2_UNWIND_INFO
ifdef.  Put ifdefs around call in gen_subprogram_die.
(compute_frame_pointer_to_cfa_displacement): Likewise.
(gen_subprogram_die): Restore old code for when DWARF2_UNWIND_INFO is
not defined.

From-SVN: r106299
parent e5f9a909
2005-10-25 James E. Wilson <wilson@specifix.com> 2005-10-31 James E. Wilson <wilson@specifix.com>
PR debug/24444
* dwarf2out.c (convert_cfa_to_loc_list): Put inside DWARF2_UNWIND_INFO
ifdef. Put ifdefs around call in gen_subprogram_die.
(compute_frame_pointer_to_cfa_displacement): Likewise.
(gen_subprogram_die): Restore old code for when DWARF2_UNWIND_INFO is
not defined.
PR rtl-optimization/17356 PR rtl-optimization/17356
* cfgrtl.c (purge_dead_edges): Undo last change. In EDGE_EH code, * cfgrtl.c (purge_dead_edges): Undo last change. In EDGE_EH code,
......
...@@ -10290,6 +10290,7 @@ tree_add_const_value_attribute (dw_die_ref var_die, tree decl) ...@@ -10290,6 +10290,7 @@ tree_add_const_value_attribute (dw_die_ref var_die, tree decl)
add_const_value_attribute (var_die, rtl); add_const_value_attribute (var_die, rtl);
} }
#ifdef DWARF2_UNWIND_INFO
/* Convert the CFI instructions for the current function into a location /* Convert the CFI instructions for the current function into a location
list. This is used for DW_AT_frame_base when we targeting a dwarf2 list. This is used for DW_AT_frame_base when we targeting a dwarf2
consumer that does not support the dwarf3 DW_OP_call_frame_cfa. */ consumer that does not support the dwarf3 DW_OP_call_frame_cfa. */
...@@ -10381,6 +10382,7 @@ compute_frame_pointer_to_cfa_displacement (void) ...@@ -10381,6 +10382,7 @@ compute_frame_pointer_to_cfa_displacement (void)
frame_pointer_cfa_offset = -offset; frame_pointer_cfa_offset = -offset;
} }
#endif
/* Generate a DW_AT_name attribute given some string value to be included as /* Generate a DW_AT_name attribute given some string value to be included as
the value of the attribute. */ the value of the attribute. */
...@@ -11606,6 +11608,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) ...@@ -11606,6 +11608,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
add_AT_fde_ref (subr_die, DW_AT_MIPS_fde, current_funcdef_fde); add_AT_fde_ref (subr_die, DW_AT_MIPS_fde, current_funcdef_fde);
#endif #endif
#ifdef DWARF2_UNWIND_INFO
/* We define the "frame base" as the function's CFA. This is more /* We define the "frame base" as the function's CFA. This is more
convenient for several reasons: (1) It's stable across the prologue convenient for several reasons: (1) It's stable across the prologue
and epilogue, which makes it better than just a frame pointer, and epilogue, which makes it better than just a frame pointer,
...@@ -11632,6 +11635,17 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) ...@@ -11632,6 +11635,17 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
debugger about. We'll need to adjust all frame_base references debugger about. We'll need to adjust all frame_base references
by this displacement. */ by this displacement. */
compute_frame_pointer_to_cfa_displacement (); compute_frame_pointer_to_cfa_displacement ();
#else
/* For targets which support DWARF2, but not DWARF2 call-frame info,
we just use the stack pointer or frame pointer. */
/* ??? Should investigate getting better info via callbacks, or else
by interpreting the IA-64 unwind info. */
{
rtx fp_reg
= frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx;
add_AT_loc (subr_die, DW_AT_frame_base, reg_loc_descriptor (fp_reg));
}
#endif
if (cfun->static_chain_decl) if (cfun->static_chain_decl)
add_AT_location_description (subr_die, DW_AT_static_link, add_AT_location_description (subr_die, DW_AT_static_link,
......
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