public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section
@ 2004-10-14  8:22 tsandnes at atmel dot com
  2004-10-14 13:24 ` [Bug target/17994] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: tsandnes at atmel dot com @ 2004-10-14  8:22 UTC (permalink / raw)
  To: gcc-bugs

avr-gcc-v:
Reading specs from c:/programs/WinAVR/bin/../lib/gcc/avr/3.4.1/specs
Configured with: ../gcc-3.4.1/configure --prefix=e:/avrdev/install
--build=mingw32 --host=mingw32 --target=avr --enable-languages=c,c++
Thread model: single
gcc version 3.4.1

command line:
avr-gcc -gdwarf-2 anycode.c  -o anyobject.elf

No matter how I tweak the command line parameters to avr-gcc I am unable to make
it output dwarf2 callstack information (.debug_frame). I have confirmed that
this is a missing feature for the AVR port.

-- 
           Summary: avr-gcc does not output a dwarf2 .debug_frame section
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tsandnes at atmel dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: 386
GCC target triplet: AVR


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
  2004-10-14  8:22 [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section tsandnes at atmel dot com
@ 2004-10-14 13:24 ` pinskia at gcc dot gnu dot org
  2004-10-14 13:24 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-14 13:24 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
  2004-10-14  8:22 [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section tsandnes at atmel dot com
  2004-10-14 13:24 ` [Bug target/17994] " pinskia at gcc dot gnu dot org
@ 2004-10-14 13:24 ` pinskia at gcc dot gnu dot org
  2004-10-14 16:39 ` ericw at evcohs dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-14 13:24 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|debug                       |target


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
  2004-10-14  8:22 [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section tsandnes at atmel dot com
  2004-10-14 13:24 ` [Bug target/17994] " pinskia at gcc dot gnu dot org
  2004-10-14 13:24 ` pinskia at gcc dot gnu dot org
@ 2004-10-14 16:39 ` ericw at evcohs dot com
  2004-11-13 16:17 ` berndtrog at yahoo dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: ericw at evcohs dot com @ 2004-10-14 16:39 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ericw at evcohs dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
  2004-10-14  8:22 [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section tsandnes at atmel dot com
                   ` (2 preceding siblings ...)
  2004-10-14 16:39 ` ericw at evcohs dot com
@ 2004-11-13 16:17 ` berndtrog at yahoo dot com
  2005-02-11 23:09 ` ericw at evcohs dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: berndtrog at yahoo dot com @ 2004-11-13 16:17 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |berndtrog at yahoo dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
  2004-10-14  8:22 [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section tsandnes at atmel dot com
                   ` (3 preceding siblings ...)
  2004-11-13 16:17 ` berndtrog at yahoo dot com
@ 2005-02-11 23:09 ` ericw at evcohs dot com
  2005-03-16 16:54 ` ericw at evcohs dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: ericw at evcohs dot com @ 2005-02-11 23:09 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bjoern dot m dot haase at
                   |                            |web dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
  2004-10-14  8:22 [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section tsandnes at atmel dot com
                   ` (4 preceding siblings ...)
  2005-02-11 23:09 ` ericw at evcohs dot com
@ 2005-03-16 16:54 ` ericw at evcohs dot com
  2005-05-06 13:59 ` bjoern dot m dot haase at web dot de
  2005-07-27 23:37 ` giovannibajo at libero dot it
  7 siblings, 0 replies; 19+ messages in thread
From: ericw at evcohs dot com @ 2005-03-16 16:54 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |19885


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
  2004-10-14  8:22 [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section tsandnes at atmel dot com
                   ` (5 preceding siblings ...)
  2005-03-16 16:54 ` ericw at evcohs dot com
@ 2005-05-06 13:59 ` bjoern dot m dot haase at web dot de
  2005-07-27 23:37 ` giovannibajo at libero dot it
  7 siblings, 0 replies; 19+ messages in thread
From: bjoern dot m dot haase at web dot de @ 2005-05-06 13:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bjoern dot m dot haase at web dot de  2005-05-06 13:59 -------
Hi, 
 
I have been reviewing PR19885 and come to the following conclusions: 
 
1.) As expected, Torleif is right: I can confirm that the problem exists,  
2.) it should, however, probably be called rather a request for enhancement 
than a bug: Beside call stack information the debugging info should be ok in 
principle. 
3.) There seems to be only one little part missing in order to add the call 
stack information as well: The back-end needs to provide the information at 
which memory address the debugger could localize the return address. This would 
require to implement the target hook INCOMING_RETURN_ADDR_RTX and use the 
RTX_FRAME_RELATED_P predicate for all of the prologue/epilogue insn. 
 
I think the best way to address this issue would be to resolve this issue 
simultaneously when switching from asm-prologue/epilogue to 
RTL-prologue/epilogue. Since Andy Hutchinson is just working on this issue, we 
might soon have a solution. Hopefully :-). Would be very helpfull to have call 
stack info in avrstudio. 
 
Yours, 
 
Bjoern 
 
P.S.:  
I hope you will not be flaming me for adding you on the CC list. :-) Just 
thought that you might be interrested since I know you are working on the 
prologue/epilogue issue. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hutchinsonandy at netscape
                   |                            |dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
  2004-10-14  8:22 [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section tsandnes at atmel dot com
                   ` (6 preceding siblings ...)
  2005-05-06 13:59 ` bjoern dot m dot haase at web dot de
@ 2005-07-27 23:37 ` giovannibajo at libero dot it
  7 siblings, 0 replies; 19+ messages in thread
From: giovannibajo at libero dot it @ 2005-07-27 23:37 UTC (permalink / raw)
  To: gcc-bugs



-- 
Bug 17994 depends on bug 19885, which changed state.

Bug 19885 Summary: [4.0/4.1 Regression] avr dwarf-2 support is broken for head 4.0/4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19885

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
             Status|WAITING                     |RESOLVED
         Resolution|                            |FIXED

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2011-08-02 20:46 ` Torleif.Sandnes at atmel dot com
@ 2011-08-02 20:50 ` rth at gcc dot gnu.org
  7 siblings, 0 replies; 19+ messages in thread
From: rth at gcc dot gnu.org @ 2011-08-02 20:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

Richard Henderson <rth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #11 from Richard Henderson <rth at gcc dot gnu.org> 2011-08-02 20:49:40 UTC ---
Fixed for 4.7.  Will not be backported to earlier branches.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2011-02-16 18:16 ` rth at gcc dot gnu.org
@ 2011-08-02 20:46 ` Torleif.Sandnes at atmel dot com
  2011-08-02 20:50 ` rth at gcc dot gnu.org
  7 siblings, 0 replies; 19+ messages in thread
From: Torleif.Sandnes at atmel dot com @ 2011-08-02 20:46 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

--- Comment #10 from Torleif.Sandnes at atmel dot com 2011-08-02 20:46:09 UTC ---
I am on vacation, but will be back 8th August.

Torleif Sandnes


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2011-02-16  8:28 ` anitha.boyapati at atmel dot com
@ 2011-02-16 18:16 ` rth at gcc dot gnu.org
  2011-08-02 20:46 ` Torleif.Sandnes at atmel dot com
  2011-08-02 20:50 ` rth at gcc dot gnu.org
  7 siblings, 0 replies; 19+ messages in thread
From: rth at gcc dot gnu.org @ 2011-02-16 18:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

--- Comment #9 from Richard Henderson <rth at gcc dot gnu.org> 2011-02-16 18:04:08 UTC ---
> Going by the internals document, INCOMING_FRAME_SP_OFFSET is already defined
> but it is not used anywhere (in my patch).

Certainly it's going to be used by the generic code in dwarf2out_frame_init,
and if that's wrong everything that follows will be off as well.

> INCOMING_RETURN_ADDR_RTX per se is not using POST_DEC. But once they are
> defined to some values, during the libgcc build, an ICE is hit in
> dwarf2out_frame_debug_expr(). If POST_DEC mode is defined, ICE disappears. I am
> yet to understand the relation between the POST_DEC and ICE and why it appears
> when only CFI is being emitted.

Ah, I see.  Nothing to do with the initial frame setup, but the rest of the
unwind info, since AVR uses POST_DEC for pushes.

See 

  http://gcc.gnu.org/ml/gcc-patches/2011-02/msg01059.html

for my proposed patch for this.  Note that the message contains both gas
and gcc patches.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2011-02-15 19:39 ` rth at gcc dot gnu.org
@ 2011-02-16  8:28 ` anitha.boyapati at atmel dot com
  2011-02-16 18:16 ` rth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: anitha.boyapati at atmel dot com @ 2011-02-16  8:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

--- Comment #8 from Anitha Boyapati <anitha.boyapati at atmel dot com> 2011-02-16 08:20:03 UTC ---
Created attachment 23360
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23360
Initial fix that emits the output shown in comment 5

(In reply to comment #7)
> (In reply to comment #6)
> > The reason for ICE is that POST_DEC is not handled in
> > dwarf2out_frame_debug_expr(). Fixing that issue will enable the compiler to
> > generate the call-stack debug info.
> This is handled by properly defining INCOMING_FRAME_SP_OFFSET.
> You don't need a POST_DEC in the INCOMING_RETURN_ADDR_RTX definition.
> C.f. the i386 versions of these, which set up the exact same sort of
> on-stack return address.


Going by the internals document, INCOMING_FRAME_SP_OFFSET is already defined
but it is not used anywhere (in my patch).

Looking at i386, I understand that the return address is stored on the stack
much in the same way. However, what I dont understand is the requirement for
cfa initialization in prologue expansion. This is something not handled in AVR. 

> You don't need a POST_DEC in the INCOMING_RETURN_ADDR_RTX definition.

INCOMING_RETURN_ADDR_RTX per se is not using POST_DEC. But once they are
defined to some values, during the libgcc build, an ICE is hit in
dwarf2out_frame_debug_expr(). If POST_DEC mode is defined, ICE disappears. I am
yet to understand the relation between the POST_DEC and ICE and why it appears
when only CFI is being emitted.


Attaching the patch.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2010-12-29 13:35 ` anitha.boyapati at atmel dot com
@ 2011-02-15 19:39 ` rth at gcc dot gnu.org
  2011-02-16  8:28 ` anitha.boyapati at atmel dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: rth at gcc dot gnu.org @ 2011-02-15 19:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

Richard Henderson <rth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu.org

--- Comment #7 from Richard Henderson <rth at gcc dot gnu.org> 2011-02-15 19:36:28 UTC ---
(In reply to comment #6)
> The reason for ICE is that POST_DEC is not handled in
> dwarf2out_frame_debug_expr(). Fixing that issue will enable the compiler to
> generate the call-stack debug info.

This is handled by properly defining INCOMING_FRAME_SP_OFFSET.
You don't need a POST_DEC in the INCOMING_RETURN_ADDR_RTX definition.

C.f. the i386 versions of these, which set up the exact same sort of
on-stack return address.


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-4@http.gcc.gnu.org/bugzilla/>
  2010-12-29  7:05 ` anitha.boyapati at atmel dot com
  2010-12-29  7:08 ` anitha.boyapati at atmel dot com
@ 2010-12-29 13:35 ` anitha.boyapati at atmel dot com
  2011-02-15 19:39 ` rth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: anitha.boyapati at atmel dot com @ 2010-12-29 13:35 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

--- Comment #6 from Anitha Boyapati <anitha.boyapati at atmel dot com> 2010-12-29 13:35:34 UTC ---
(In reply to comment #4)

> Looks like to get call-stack debug info, all we require to do is define
> INCOMING_RETURN_ADDR_RTX. In AVR, since the return address is pushed onto the
> stack for every call instruction, the above hook is defined to
> avr_incoming_return_addr_rtx() of dwarf2out.c:
> 
> rtx
> avr_incoming_return_addr_rtx(void) {
> 
>     return gen_rtx_MEM (HImode, stack_pointer_rtx);
> }
> 
> And this gives an ICE in dwarf2out_frame_debug_expr(). Modifying the above
> function to pre decrement the stack pointer gives an ICE in
> initial_return_save()
> 

The reason for ICE is that POST_DEC is not handled in
dwarf2out_frame_debug_expr(). Fixing that issue will enable the compiler to
generate the call-stack debug info.

http://gcc.gnu.org/ml/gcc/2010-12/msg00474.html

#simple testcase:
void foo(){ return ;}
int main() { foo(); return 1; }


The output of .debug_frame section for the above testcase(just assembled):

00000000 00000010 ffffffff CIE
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -1
  Return address column: 36

  DW_CFA_def_cfa: r32 ofs 2
  DW_CFA_offset: r36 at cfa+0
  DW_CFA_nop
  DW_CFA_nop

00000014 00000014 00000000 FDE cie=00000000 pc=00000000..0000000e
  DW_CFA_advance_loc: 4 to 00000004
  DW_CFA_offset: r28 at cfa+0
  DW_CFA_advance_loc: 4 to 00000008
  DW_CFA_def_cfa_register: r28
  DW_CFA_nop
  DW_CFA_nop

0000002c 00000014 00000000 FDE cie=00000000 pc=0000000e..00000022
  DW_CFA_advance_loc: 4 to 00000012
  DW_CFA_offset: r28 at cfa+0
  DW_CFA_advance_loc: 4 to 00000016
  DW_CFA_def_cfa_register: r28
  DW_CFA_nop
  DW_CFA_nop

Comments on correctness appreciated :)


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-4@http.gcc.gnu.org/bugzilla/>
  2010-12-29  7:05 ` anitha.boyapati at atmel dot com
@ 2010-12-29  7:08 ` anitha.boyapati at atmel dot com
  2010-12-29 13:35 ` anitha.boyapati at atmel dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: anitha.boyapati at atmel dot com @ 2010-12-29  7:08 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

--- Comment #5 from Anitha Boyapati <anitha.boyapati at atmel dot com> 2010-12-29 07:08:33 UTC ---
(In reply to comment #4)

> 
> And this gives an ICE in dwarf2out_frame_debug_expr(). Modifying the above
> function to pre decrement the stack pointer gives an ICE in
> initial_return_save()
> 
> gen_rtx_MEM (HImode, gen_rtx_PRE_DEC (HImode, stack_pointer_rtx))

gcc version - 4.4.3


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-4@http.gcc.gnu.org/bugzilla/>
@ 2010-12-29  7:05 ` anitha.boyapati at atmel dot com
  2010-12-29  7:08 ` anitha.boyapati at atmel dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 19+ messages in thread
From: anitha.boyapati at atmel dot com @ 2010-12-29  7:05 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994

Anitha Boyapati <anitha.boyapati at atmel dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anitha.boyapati at atmel
                   |                            |dot com

--- Comment #4 from Anitha Boyapati <anitha.boyapati at atmel dot com> 2010-12-29 07:05:09 UTC ---
(In reply to comment #1)

> 3.) There seems to be only one little part missing in order to add the call 
> stack information as well: The back-end needs to provide the information at 
> which memory address the debugger could localize the return address. This would 
> require to implement the target hook INCOMING_RETURN_ADDR_RTX and use the 
> RTX_FRAME_RELATED_P predicate for all of the prologue/epilogue insn. 


I know this has been delayed for too long. But I thought a small update would
perhaps help.

Looks like to get call-stack debug info, all we require to do is define
INCOMING_RETURN_ADDR_RTX. In AVR, since the return address is pushed onto the
stack for every call instruction, the above hook is defined to
avr_incoming_return_addr_rtx() of dwarf2out.c:

rtx
avr_incoming_return_addr_rtx(void) {

    return gen_rtx_MEM (HImode, stack_pointer_rtx);
}

And this gives an ICE in dwarf2out_frame_debug_expr(). Modifying the above
function to pre decrement the stack pointer gives an ICE in
initial_return_save()

gen_rtx_MEM (HImode, gen_rtx_PRE_DEC (HImode, stack_pointer_rtx))


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-9466@http.gcc.gnu.org/bugzilla/>
  2009-08-20 22:40 ` eric dot weddington at atmel dot com
@ 2009-10-23 11:41 ` tsandnes at atmel dot com
  1 sibling, 0 replies; 19+ messages in thread
From: tsandnes at atmel dot com @ 2009-10-23 11:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tsandnes at atmel dot com  2009-10-23 11:41 -------
I tried gcc 4.3.2 from the WinAVR distribution and also avr-gcc 4.4.1.

The short story is: There is call frame information there, but not enough.
Specifically, the Call Frame instructions to reconstruct the pc to unwind rule
table are still missing, but the CIE and FDE are present. 

I compared gcc and avr-gcc output on linux with the following results:

gcc:
-----------------------------------------------------------------------
The section .debug_frame contains:

00000000 00000010 ffffffff CIE
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -4
  Return address column: 8

  DW_CFA_def_cfa: r4 (esp) ofs 4
  DW_CFA_offset: r8 (eip) at cfa-4
  DW_CFA_nop
  DW_CFA_nop

00000014 00000024 00000000 FDE cie=00000000 pc=08048394..0804840a
  DW_CFA_advance_loc: 4 to 08048398
  DW_CFA_def_cfa: r1 (ecx) ofs 0
  DW_CFA_register: r4 (esp) in r1 (ecx)
  DW_CFA_advance_loc: 6 to 0804839e
  DW_CFA_def_cfa: r4 (esp) ofs 4
  DW_CFA_advance_loc: 1 to 0804839f
  DW_CFA_def_cfa_offset: 8
  DW_CFA_offset: r5 (ebp) at cfa-8
  DW_CFA_advance_loc: 2 to 080483a1
  DW_CFA_def_cfa_register: r5 (ebp)
  DW_CFA_advance_loc: 1 to 080483a2
  DW_CFA_offset: r4 (esp) at cfa-12
  DW_CFA_nop
  DW_CFA_nop

0000003c 00000014 00000000 FDE cie=00000000 pc=0804840a..0804841c
  DW_CFA_advance_loc: 1 to 0804840b
  DW_CFA_def_cfa_offset: 8
  DW_CFA_offset: r5 (ebp) at cfa-8
  DW_CFA_advance_loc: 2 to 0804840d
  DW_CFA_def_cfa_register: r5 (ebp)

-----------------------------------------------------------------------

avr-gcc 

-----------------------------------------------------------------------
00000000 0000000c ffffffff CIE
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -1
  Return address column: 36

  DW_CFA_def_cfa: r32 ofs 0

00000010 0000000c 00000000 FDE cie=00000000 pc=000000ce..00000160

00000020 0000000c 00000000 FDE cie=00000000 pc=00000160..0000018c

-----------------------------------------------------------------------


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [Bug target/17994] avr-gcc does not output a dwarf2 .debug_frame section
       [not found] <bug-17994-9466@http.gcc.gnu.org/bugzilla/>
@ 2009-08-20 22:40 ` eric dot weddington at atmel dot com
  2009-10-23 11:41 ` tsandnes at atmel dot com
  1 sibling, 0 replies; 19+ messages in thread
From: eric dot weddington at atmel dot com @ 2009-08-20 22:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from eric dot weddington at atmel dot com  2009-08-20 22:40 -------
Hi Torleif,

Please check more recent versions such as 4.3.2, 4.3.3, or 4.4.0. There are
.debug_frame sections in there, but I don't know if it contains the information
that you're looking for.

Thanks,
Eric Weddington


-- 

eric dot weddington at atmel dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-08-20 22:40:26
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2011-08-02 20:50 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-14  8:22 [Bug debug/17994] New: avr-gcc does not output a dwarf2 .debug_frame section tsandnes at atmel dot com
2004-10-14 13:24 ` [Bug target/17994] " pinskia at gcc dot gnu dot org
2004-10-14 13:24 ` pinskia at gcc dot gnu dot org
2004-10-14 16:39 ` ericw at evcohs dot com
2004-11-13 16:17 ` berndtrog at yahoo dot com
2005-02-11 23:09 ` ericw at evcohs dot com
2005-03-16 16:54 ` ericw at evcohs dot com
2005-05-06 13:59 ` bjoern dot m dot haase at web dot de
2005-07-27 23:37 ` giovannibajo at libero dot it
     [not found] <bug-17994-9466@http.gcc.gnu.org/bugzilla/>
2009-08-20 22:40 ` eric dot weddington at atmel dot com
2009-10-23 11:41 ` tsandnes at atmel dot com
     [not found] <bug-17994-4@http.gcc.gnu.org/bugzilla/>
2010-12-29  7:05 ` anitha.boyapati at atmel dot com
2010-12-29  7:08 ` anitha.boyapati at atmel dot com
2010-12-29 13:35 ` anitha.boyapati at atmel dot com
2011-02-15 19:39 ` rth at gcc dot gnu.org
2011-02-16  8:28 ` anitha.boyapati at atmel dot com
2011-02-16 18:16 ` rth at gcc dot gnu.org
2011-08-02 20:46 ` Torleif.Sandnes at atmel dot com
2011-08-02 20:50 ` rth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).