From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21130 invoked by alias); 28 Sep 2006 01:19:16 -0000 Received: (qmail 21122 invoked by uid 22791); 28 Sep 2006 01:19:15 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 28 Sep 2006 01:19:13 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GSkYQ-0005Gd-NQ; Wed, 27 Sep 2006 21:19:10 -0400 Date: Thu, 28 Sep 2006 01:19:00 -0000 From: Daniel Jacobowitz To: Maxim Grigoriev Cc: gdb-patches@sources.redhat.com, Bob Wilson , Marc Gauthier Subject: Re: Xtensa GDB port -- revised patch Message-ID: <20060928011910.GA20142@nevyn.them.org> Mail-Followup-To: Maxim Grigoriev , gdb-patches@sources.redhat.com, Bob Wilson , Marc Gauthier References: <451B202C.3090804@hq.tensilica.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <451B202C.3090804@hq.tensilica.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00204.txt.bz2 On Wed, Sep 27, 2006 at 06:06:52PM -0700, Maxim Grigoriev wrote: > After some investigation, it turns out that the get_fp_num() function, > which was "grubbing around in the private data structures of the symbol > reader", is not needed at all. Perhaps that code was left over from an > earlier version of GDB. Stack unwinding on Xtensa can be done using the > register windows -- it requires neither prologue analysis to find the > frame pointer nor DWARF unwind info. The only thing the get_fp_num() > function was used for was identifying frames, but it seems like we can > just use the stack pointer for the frame ID. (Is that right?) I've > changed the code to do this and it appears to work fine: no DejaGnu > regression has been detected, and manual testing on alloca-tests hasn't > exposed anything. I'm not entirely sure, but I think you're off by one frame. The goal is to use a long-lived value which will never change during a single execution of a function. So we normally use the DWARF concept of a "Call Frame Address" - the stack pointer at the time of the call. If you use the current stack pointer for the frame, then you are liable to change the ID during execution of a function, while single stepping. Normally this isn't a big problem; I don't remember offhand what the usual symptoms are. Can you use the previous frame's stack pointer instead? Is that going to work? -- Daniel Jacobowitz CodeSourcery