From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2004 invoked by alias); 8 Oct 2007 13:03:10 -0000 Received: (qmail 1989 invoked by uid 22791); 8 Oct 2007 13:03:09 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate4.de.ibm.com (HELO mtagate4.de.ibm.com) (195.212.29.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 08 Oct 2007 13:03:03 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate4.de.ibm.com (8.13.8/8.13.8) with ESMTP id l98D30Y3135002 for ; Mon, 8 Oct 2007 13:03:00 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 l98D2wHt2105574 for ; Mon, 8 Oct 2007 15:03:00 +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 l98D2vMk010676 for ; Mon, 8 Oct 2007 15:02:58 +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 l98D2pKk010603; Mon, 8 Oct 2007 15:02:55 +0200 Message-Id: <200710081302.l98D2pKk010603@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 8 Oct 2007 15:02:51 +0200 Subject: Re: [rfc] [00/16] Get rid of current gdbarch To: deuling@de.ibm.com (Markus Deuling) Date: Mon, 08 Oct 2007 13:03:00 -0000 From: "Ulrich Weigand" Cc: 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: <4709E786.1070502@de.ibm.com> from "Markus Deuling" at Oct 08, 2007 10:17:10 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/msg00139.txt.bz2 Markus Deuling wrote: > This patch set replaces some of the current_gdbarch's in following files: > > * aix-thread.c > * arm-tdep.c > * alpha-{linux-nat,nat,tdep}.c > * findvar.c > * amd64-{nat,tdep}.c > * i386-tdep.c > * sh[64]-tdep.c > * remote.c > * irix5-nat.c > * regcache.c > * m68k{linux-nat, linux-tdep, -tdep}.c > * dwarf2{loc, -frame}.c > * cris-tdep.c > * hppa-{hpux-nat, hpux-tdep, linux-nat, tdep}.c I've checked all of those in, except for the i386-tdep.c one: @@ -169,6 +169,8 @@ i386_register_name (int regnum) static int i386_dbx_reg_to_regnum (int reg) { + struct gdbarch *gdbarch = get_frame_arch (get_current_frame ()); + /* This implements what GCC calls the "default" register map (dbx_register_map[]). */ 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.) Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com