From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17690 invoked by alias); 13 Jun 2007 13:06:20 -0000 Received: (qmail 17679 invoked by uid 22791); 13 Jun 2007 13:06:19 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 13 Jun 2007 13:06:16 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id l5DD6BBc641256 for ; Wed, 13 Jun 2007 13:06:11 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.3) with ESMTP id l5DD6BFg4001950 for ; Wed, 13 Jun 2007 15:06:11 +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 l5DD6BZe021077 for ; Wed, 13 Jun 2007 15:06:11 +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 l5DD6BO8021072; Wed, 13 Jun 2007 15:06:11 +0200 Message-Id: <200706131306.l5DD6BO8021072@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 13 Jun 2007 15:06:11 +0200 Subject: Re: [2/10] Remove &builtin_type_ from tdep code (amd64/s390/sparc64) To: vladimir@codesourcery.com (Vladimir Prus) Date: Wed, 13 Jun 2007 13:06:00 -0000 From: "Ulrich Weigand" Cc: drow@false.org (Daniel Jacobowitz), gdb-patches@sourceware.org In-Reply-To: <200706131108.00541.vladimir@codesourcery.com> from "Vladimir Prus" at Jun 13, 2007 11:08:00 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-06/txt/msg00221.txt.bz2 Vladimir Prus wrote: > I suppose I can change m68k_register_type to directly return > the type, but I'm not sure why > > return builtin_type_double; > > is better than: > > return *x; > > where x = &builtin_type_double; builtin_type_double is currently a global variable that is gdbarch-swapped, i.e. whenever current_gdbarch switches, the value of that global variable is re-set. This is awkward and makes is hard to use any other gdbarch (that is not currently installed as current_gdbarch) reliably, which is what my patch set is intended to fix. To that purpose, the builtin_type_double global variable will go away, and is (temporarily) replaced by a macro #define builtin_type_double builtin_type (current_gdbarch)->builtin_double However, this macro is not fully equivalent; in particular it is no longer possible to use &builtin_type_double. Longer term, that compatibility macro will go away as well, and your return builtin_type_double; should be replaced by return builtin_type (gdbarch)->builtin_double; using the "gdbarch" you get as input to ..._register_type instead of the global current_gdbarch. (If you prefer, you can certainly use that form right away.) Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com