From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8649 invoked by alias); 7 Mar 2003 17:52:01 -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 8638 invoked from network); 7 Mar 2003 17:52:00 -0000 Received: from unknown (HELO mx1.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 7 Mar 2003 17:52:00 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h27Hq0Q19668 for ; Fri, 7 Mar 2003 12:52:00 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h27HprV06023; Fri, 7 Mar 2003 12:51:53 -0500 Received: from localhost.localdomain (vpn50-19.rdu.redhat.com [172.16.50.19]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h27HpqC10591; Fri, 7 Mar 2003 12:51:52 -0500 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h27Hpkj16169; Fri, 7 Mar 2003 10:51:46 -0700 Date: Fri, 07 Mar 2003 17:52:00 -0000 From: Kevin Buettner Message-Id: <1030307175146.ZM16168@localhost.localdomain> In-Reply-To: Andrew Cagney "Re: [RFA] mips-tdep.c: Add dwarf/dwarf2 regnum mapping functions" (Mar 7, 12:03pm) References: <1030304211701.ZM24618@localhost.localdomain> <3E68D0FD.2010809@redhat.com> To: Andrew Cagney Subject: Re: [RFA] mips-tdep.c: Add dwarf/dwarf2 regnum mapping functions Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-03/txt/msg00172.txt.bz2 On Mar 7, 12:03pm, Andrew Cagney wrote: > > [Note: Irix cross some other mips target is currently broken due to > > the fact that FP0_REGNUM is not multiarched yet.] > > I don't think FP0_REGNUM should be multi-arched. The only reference to I should point out that FP0_REGNUM is already in gdbarch.h. What I meant was that mips should be calling set_gdbarch_fp0_regnum() instead of defining it via a macro in the tm-*.h files. [...FP0_REGNUM reference in generic code elided] > mips_tdep could certainly gain a local tdep->fp0_regnum though. Did you notice the references to FP0_REGNUM in mips-linux-tdep.c and mips-nat.c?. If we do as you suggest, an access method will need to be added to mips-tdep.h for getting at tdep->fp0_regnum (since you refuse to export the mips tdep struct). Also, all occurrences of FP0_REGNUM in mips-linux-tdep.c and mips-nat.c will need to be rewritten to use this access method. Certainly all of this could be done, but the need to know the first floating point register number is something that's shared among a number of ports. Doesn't it makes sense to define (as has already been done) a common mechanism for determining this register number rather than letting each port develop ad hoc methods? > > Okay? > > Yes, just make it a little bit more robust. The i386 does this: > > /* This will hopefully provoke a warning. */ > return NUM_REGS + NUM_PSEUDO_REGS; > > when it doesn't know what to do with a register. Rather than hoping that returning an out of range register number will provoke a warning (at some indeterminate point in the future), wouldn't it be better to call complaint() directly? Or, alternatively, define a return value (e.g. -1) which callers of *_REG_TO_REGNUM would then check so that an appropriate complaint could be registered? Kevin