From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 556 invoked by alias); 10 Jun 2009 15:36:30 -0000 Received: (qmail 543 invoked by uid 22791); 10 Jun 2009 15:36:30 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_PASS 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.43rc1) with ESMTP; Wed, 10 Jun 2009 15:36:21 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.14.3/8.13.8) with ESMTP id n5AFaGbD700134 for ; Wed, 10 Jun 2009 15:36:16 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 n5AFaGtk3449056 for ; Wed, 10 Jun 2009 17:36:16 +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 n5AFaFPI000712 for ; Wed, 10 Jun 2009 17:36:16 +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 n5AFaEDM000676; Wed, 10 Jun 2009 17:36:14 +0200 Message-Id: <200906101536.n5AFaEDM000676@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 10 Jun 2009 17:36:14 +0200 Subject: Re: [01/15] Introduce get_current_arch () function To: tromey@redhat.com Date: Wed, 10 Jun 2009 15:36:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: from "Tom Tromey" at Jun 09, 2009 11:04:08 AM 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/msg00256.txt.bz2 Tom Tromey wrote: > >>>>> "Ulrich" == Ulrich Weigand writes: > > Ulrich> printf_command (char *arg, int from_tty) > Ulrich> { > Ulrich> + struct gdbarch *gdbarch = get_current_arch (); > > I think that perhaps the printf command should use the arch from the > values it is trying to print. > > Ulrich> struct type *wctype = lookup_typename (current_language, > Ulrich> - current_gdbarch, > Ulrich> + gdbarch, > Ulrich> "wchar_t", NULL, 0); > > E.g., here it could use the architecture from val_args[i]. > > The benefit here would be that you could print out two wide strings, > each from a different architecture, using a single printf. This seems > like a reasonable thing to want to do. There wouldn't really be much of a difference today, as the architecture of val_args[i] is the architecture of the expression from which it was evaluated, which is likewise get_current_arch (). However, you're right that it would be more straightforward to use the value arch here, in case we might later decide to allow evaluation of an expression to return values in a different arch. Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com