diff mbox

[dwarf] :

Message ID A95C7A9F-F289-49DD-A531-6F2455D275A8@adacore.com
State New
Headers show

Commit Message

Tristan Gingold March 14, 2012, 3:45 p.m. UTC
Hi,

the dwarf3 DW_OP_call_frame_cfa implicitly refers to .debug_frame section.  But if we aren't
emitting dwarf unwinding info, it isn't anymore well defined.

There is one target that doesn't emit dwarf unwind info: ia64.  And gdb is not able to deal
with DW_OP_call_frame_cfa on ia64, thus breaking -gdwarf-3.

I think the simplest is to disable this opcode for such targets.

Manually tested with gdb on ia64-linux.
No regressions for x86_64-darwin.

Ok for trunk ?

Tristan.

2012-03-14  Tristan Gingold  <gingold@adacore.com>

	* dwarf2out.c (gen_subprogram_die): Require dwarf unwinding to
	use DW_OP_call_frame_cfa.

Comments

Jason Merrill March 14, 2012, 5:50 p.m. UTC | #1
OK.

Jason
Tristan Gingold March 15, 2012, 8:46 a.m. UTC | #2
Thanks, committed.

(And sorry for the truncated subject).

Tristan.

On Mar 14, 2012, at 6:50 PM, Jason Merrill wrote:

> OK.
> 
> Jason
diff mbox

Patch

diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index b5f921a..b43dfcf 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -17485,7 +17485,7 @@  gen_subprogram_die (tree decl, dw_die_ref context_die)
         (3) We can at least reuse the code inspection and interpretation
         code that determines the CFA position at various points in the
         function.  */
-      if (dwarf_version >= 3)
+      if (dwarf_version >= 3 && targetm.debug_unwind_info () == UI_DWARF2)
        {
          dw_loc_descr_ref op = new_loc_descr (DW_OP_call_frame_cfa, 0, 0);
          add_AT_loc (subr_die, DW_AT_frame_base, op);