From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32045 invoked by alias); 7 Mar 2003 18:52:23 -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 32038 invoked from network); 7 Mar 2003 18:52:23 -0000 Received: from unknown (HELO localhost.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 7 Mar 2003 18:52:23 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id DAA4B2A9C; Fri, 7 Mar 2003 13:52:19 -0500 (EST) Message-ID: <3E68EA63.10401@redhat.com> Date: Fri, 07 Mar 2003 18:52:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] mips-tdep.c: Add dwarf/dwarf2 regnum mapping functions References: <1030304211701.ZM24618@localhost.localdomain> <3E68D0FD.2010809@redhat.com> <1030307175146.ZM16168@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-03/txt/msg00175.txt.bz2 > 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? True. In the mean time, these new methods might as well be consistent with the other existing reg_to_regnum methods (from memory, it does eventually provoke a warning). Andrew