From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25788 invoked by alias); 2 May 2009 09:21:41 -0000 Received: (qmail 25778 invoked by uid 22791); 2 May 2009 09:21:40 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.redpinesignals.com (HELO mail.redpinesignals.com) (203.196.161.92) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 02 May 2009 09:21:36 +0000 Received: from [192.168.40.83] ([192.168.40.83]) (authenticated user nagaraju.m@redpinesignals.com) by mail.redpinesignals.com; Sat, 2 May 2009 14:51:57 +0530 Message-ID: <49FC0F93.6020807@redpinesignals.com> Date: Sat, 02 May 2009 09:21:00 -0000 From: "nagaraju.m" User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Joel Brobecker CC: gdb@sourceware.org Subject: Re: back trace issue Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2009-05/txt/msg00005.txt.bz2 Hi Joel, I identified the function init_extraframe_info [..]-tdep.c file. I made frame_info **prev* to point to previous frame and it is displaying all the frame..... but it is working only when we start the program from main (i.e when we break at main)... suppose if we break at some function XYZ called by main then it is not working... Is there any other file where we should provide this *prev* information...... Thanks, Nagaraju Joel Brobecker wrote: >> can you please suggest me where to provide the information to gdb so >> that "back trace" works properly..... >> > > Typically, the [...]-tdep file for your architecture will provide > a set of routines that compute the value of a register in the caller's > frame (aka the "previous" frame) given a struct frame_info and and > its associated frame cache. Have a look at some of the -tdep.c files, > and search for "_prev_register", or "_this_id". That should give you > a few leads. I'll also mention that there is a new module in > prologue-value.[hc] that can simplify your job when doing prologue > analysis. I am mentioning it because it's relatively use a still > little used. > > Also, if your target supports DWARF, you might also want to see if > the they produce CFI info, in which case a DWARF-based unwinder would > be able to compute your backtrace without requiring the prologue > analyzer. I can't remember the names of the routines but you'll need > to provide a gdbarch routine that converts a dwarf register number > into the associated GDB register number. And then hook in the dwarf > unwinder sniffers: dwarf2_append_unwinders. Again, have a look at > the various -tdep files. > >