This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
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.
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.
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
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 -----------------------------------------------------------------------