From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15033 invoked by alias); 13 Feb 2011 02:34:47 -0000 Received: (qmail 14815 invoked by uid 22791); 13 Feb 2011 02:34:46 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 13 Feb 2011 02:34:41 +0000 Received: by fxm12 with SMTP id 12so4251690fxm.0 for ; Sat, 12 Feb 2011 18:34:39 -0800 (PST) Received: by 10.223.101.195 with SMTP id d3mr2543021fao.21.1297564479307; Sat, 12 Feb 2011 18:34:39 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.55.154 with HTTP; Sat, 12 Feb 2011 18:34:19 -0800 (PST) In-Reply-To: References: From: =?UTF-8?B?UGV0ciBIbHV6w61u?= Date: Sun, 13 Feb 2011 02:34:00 -0000 Message-ID: Subject: Re: Testing Call frame information in .debug_frame section To: Anitha Boyapati Cc: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-02/txt/msg00062.txt.bz2 Hi Anitha On 1 February 2011 14:03, Anitha Boyapati 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=3D17994). 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 =C2=A0gdb 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) --=20 Petr Hluzin