This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Testing Call frame information in .debug_frame section


Hi Anitha

On 1 February 2011 14:03, Anitha Boyapati <anitha.boyapati@gmail.com> wrote:
> Hello,
>
> I would like to use some help with regarding to call frame information
> present in .debug_frame section in DWARF - 2.
>
> + Firstly, I understand that .debug_frame can be used to unwind the stack.
> + Secondly, I understand that .debug_frame is optional to gdb.
> http://sourceware.org/gdb/papers/unwind.html
>
> Now I am trying to fix a bug in AVR port of gcc to emit call-frame
> information (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17994). The
> problem is testing.
>
> Initially, I thought avr-gdb can be used to backtrace/up/down with the
> newly generated elf file (with a .debug_frame section in it). However,
> avr-gdb does not seem to use this particular section. The version is
> 7.0.1. I am not sure how to test the FDEs in .debug_frame section
> other than manual inspection. I am sort of newbie with DWARF-2. So, I
> could be missing some pointers.
>
> Can someone suggest a strategy? or better yet can someone shed
> information on which features of Âgdb uses .debug_frame section.
>
> Thanks
> Anitha
>

GDB does not use CFI on Atmel AVR, see avr-tdep.c. There is only one
call to frame_unwind_append_unwinder().

I am glad to hear that GCC can somehow emit CFI data. What is the
state of the implementation?
I tried to use CFI statements in GAS (binutils), but it cannot parse
them and provides misleading diagnostics. (I even submitted a patch
for that but never received any response.)

I tried to improve GDB's ability to scan prologues a year ago, however
I ran out of enthusiasm. (The better scanner would allow stack
reconstruction even without .debug_frame/CFI info.)

I think I know where and how to hook the new CFI-based unwinder.
However I am not familiar with .debug_frame unwinding in GDB.
I am interested in writing the unwinder. I will need an example ELF
with trivial code run-able in simulator and lots of faith/enthusiasm.
(Assuming the compiler implements this spec:
http://dwarfstd.org/doc/DWARF4.pdf, or dwarf-2.0.0.pdf)

-- 
Petr Hluzin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]