From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4537 invoked by alias); 13 Sep 2002 22:16:33 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4524 invoked from network); 13 Sep 2002 22:16:32 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 13 Sep 2002 22:16:32 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17pzfv-0002on-00 for ; Fri, 13 Sep 2002 18:16:35 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17pyk7-00061D-00 for ; Fri, 13 Sep 2002 18:16:51 -0400 Date: Fri, 13 Sep 2002 15:16:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [patch/mips, rfc] Don't define FP_REGNUM Message-ID: <20020913221651.GA22958@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <3D824782.1040306@ges.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D824782.1040306@ges.redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-09/txt/msg00281.txt.bz2 On Fri, Sep 13, 2002 at 04:16:02PM -0400, Andrew Cagney wrote: > Hello, > > Ok, so this takes things out of the theory stage :-) > > The attached patch eliminates the totally bogus definition of FP_REGNUM > from the MIPS target. It was being mapped to a pseudo register and that > pseudo register, through luck, not good management, sometimes contained > the contents of the SP. It now always returns the SP. > > To get this patch working, I needed to modify > ``legacy_virtual_frame_pointer'' (used by the tracepoint code) so that > it tries FP_REGNUM and then SP_REGNUM as a possible frame pointer > register. As I write: > > - gdb_assert (FP_REGNUM >= 0); > - *frame_regnum = FP_REGNUM; > + /* FIXME: cagney/2002-09-13: This code is used when identifying the > + frame pointer of the current PC. It is assuming that a single > + register and an offset can determine this. Instead it should > + generate a byte code expression that computes the current FP. */ > + if (FP_REGNUM >= 0 && FP_REGNUM < NUM_REGS) > + *frame_regnum = FP_REGNUM; > + else if (SP_REGNUM >= 0 && SP_REGNUM < NUM_REGS) > + *frame_regnum = SP_REGNUM; > + else > + /* Should this be an internal error? I guess so, it is reflecting > + an architectural limitation in the current design. */ > + internal_error (__FILE__, __LINE__, "No virtual frame pointer > available"); > *frame_offset = 0; > > For the MIPS to work, a custom virtual_frame_pointer() function would be > needed. I don't see any point in implementing this, though, as there is > no tracepoint target to test it against. Anyway, coments on this aspect > of the patch? If not, I'll check it in. > > [Hmm, need to mention this in the NEWS file. The MIPS $fp will finally > behave as specified in the documentation.] Looks good to me. And there may someday be a tracepoint target to test it against - I hope to add tracepoints to gdbserver, eventually. When that happens I can revisit this. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer