From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11317 invoked by alias); 8 Oct 2007 14:01:46 -0000 Received: (qmail 11295 invoked by uid 22791); 8 Oct 2007 14:01:45 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 08 Oct 2007 14:01:40 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id l98E1b05204440 for ; Mon, 8 Oct 2007 14:01:37 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l98E1bOD2027592 for ; Mon, 8 Oct 2007 16:01:37 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l98E1aH3021015 for ; Mon, 8 Oct 2007 16:01:37 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l98E1a77021006; Mon, 8 Oct 2007 16:01:36 +0200 Message-Id: <200710081401.l98E1a77021006@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 8 Oct 2007 16:01:36 +0200 Subject: Re: [rfc] [00/16] Get rid of current gdbarch To: drow@false.org (Daniel Jacobowitz) Date: Mon, 08 Oct 2007 14:01:00 -0000 From: "Ulrich Weigand" Cc: deuling@de.ibm.com (Markus Deuling), gdb-patches@sourceware.org (GDB Patches), eliz@gnu.org (Eli Zaretskii), brobecker@adacore.com (Joel Brobecker), jimb@codesourcery.com (Jim Blandy), rearnsha@arm.com, mark.kettenis@xs4all.nl (Mark Kettenis) In-Reply-To: <20071008133525.GA10323@caradoc.them.org> from "Daniel Jacobowitz" at Oct 08, 2007 09:35:25 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-10/txt/msg00151.txt.bz2 Daniel Jacobowitz wrote: > On Mon, Oct 08, 2007 at 03:02:51PM +0200, Ulrich Weigand wrote: > > You should not call get_current_frame at this point; this might > > in fact fail as there is not necessarily a current frame selected > > at the point this callback is called. > > > > Instead, you should change the XXX_reg_to_regnum gdbarch entries > > from type "f" to "m"; then the functions will be automatically > > provided with a gdbarch parameter. (This should be a separate > > patch from the remaining trivial current_gdbarch replacements.) > > /* This will hopefully provoke a warning. */ > - return gdbarch_num_regs (current_gdbarch) > - + gdbarch_num_pseudo_regs (current_gdbarch); > + return gdbarch_num_regs (gdbarch) > + + gdbarch_num_pseudo_regs (gdbarch); > > That's the only thing it's used for. Does it provoke a warning? If > not, maybe -1 or something similar should... Agreed for that particular usage. In general, the reg_to_regnum routines should probably still be converted to "m" -- e.g. the rs6000 versions do make non-trivial use of the gdbarch ... Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com