From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2391 invoked by alias); 10 Jun 2009 18:27:14 -0000 Received: (qmail 2381 invoked by uid 22791); 10 Jun 2009 18:27:13 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtagate5.de.ibm.com (HELO mtagate5.de.ibm.com) (195.212.29.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Jun 2009 18:27:03 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.14.3/8.13.8) with ESMTP id n5AIQ5xr423994 for ; Wed, 10 Jun 2009 18:26:05 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 v9.2) with ESMTP id n5AIQ5k13248152 for ; Wed, 10 Jun 2009 20:26:05 +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 n5AIQ5FO013701 for ; Wed, 10 Jun 2009 20:26:05 +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 n5AIQ4sK013668; Wed, 10 Jun 2009 20:26:04 +0200 Message-Id: <200906101826.n5AIQ4sK013668@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 10 Jun 2009 20:26:04 +0200 Subject: Re: [01/15] Introduce get_current_arch () function To: pedro@codesourcery.com (Pedro Alves) Date: Wed, 10 Jun 2009 18:27:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org, tromey@redhat.com In-Reply-To: <200906101750.03206.pedro@codesourcery.com> from "Pedro Alves" at Jun 10, 2009 05:50:02 PM 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: 2009-06/txt/msg00269.txt.bz2 Pedro Alves wrote: > I haven't actually studied the patch set, so sorry if this sounds > way off, but Tom's remark made me wonder how does this interact with > re-printing values from the history ($1, $2, $nnn) or convenience > variables? As in, what would be the arch used to print $nnn? Should it > be the current arch, or the arch that was used when the value was produced? A > simple example where it can be a different arch is if you debug > inferior/target foo, print something, kill/disconnect, debug > inferior/target 2, reprint value from history. Typically, the architecture is consulted to retrieve properties the value inherently has, so using the arch used at value creation seems correct. However, I'm sure there will be places where using a value from one arch in the context of another current arch may not work quite as expected yet ... I didn't attempt to address all these issues with the current patch series yet. > I see from the hunk above that the language used is always the > current language, so it may be right to always use the current arch... Actually, I'm not sure using the current language is correct here either ... (In this particular piece of code, it doesn't seem to matter either way right now, because lookup_typename only depends on lang/arch when searching for primitive types, which wchar_t isn't.) Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com