From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14229 invoked by alias); 17 Sep 2002 21:20:53 -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 14220 invoked from network); 17 Sep 2002 21:20:51 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 17 Sep 2002 21:20:51 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 0C3733CC6; Tue, 17 Sep 2002 17:20:51 -0400 (EDT) Message-ID: <3D879CB2.7060500@ges.redhat.com> Date: Tue, 17 Sep 2002 14:20:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: [patch/mips, rfc] Don't define FP_REGNUM References: <3D824782.1040306@ges.redhat.com> <20020913221651.GA22958@nevyn.them.org> Content-Type: multipart/mixed; boundary="------------010207040702030807080708" X-SW-Source: 2002-09/txt/msg00371.txt.bz2 This is a multi-part message in MIME format. --------------010207040702030807080708 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 667 Thanks for eyeballing this. > 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. I've so far checked in the attached... Andrew --------------010207040702030807080708 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 1301 2002-09-17 Andrew Cagney * arch-utils.c (legacy_virtual_frame_pointer): If FP_REGNUM is invalid, return SP_REGNUM. Index: arch-utils.c =================================================================== RCS file: /cvs/src/src/gdb/arch-utils.c,v retrieving revision 1.68 diff -u -r1.68 arch-utils.c --- arch-utils.c 14 Sep 2002 09:40:36 -0000 1.68 +++ arch-utils.c 17 Sep 2002 21:17:58 -0000 @@ -423,8 +423,19 @@ int *frame_regnum, LONGEST *frame_offset) { - 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. I think it should + instead generate a byte code expression as that would work better + with things like Dwarf2's CFI. */ + 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; } --------------010207040702030807080708--