From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29972 invoked by alias); 2 Mar 2010 13:54:18 -0000 Received: (qmail 29958 invoked by uid 22791); 2 Mar 2010 13:54:17 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Mar 2010 13:54:12 +0000 Received: (qmail 7537 invoked from network); 2 Mar 2010 13:54:10 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 2 Mar 2010 13:54:10 -0000 Date: Tue, 02 Mar 2010 13:54:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org Subject: Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds Message-ID: <20100302135405.GA16596@caradoc.them.org> Mail-Followup-To: gdb-patches@sourceware.org References: <20100228192159.GP5683@calimero.vinschen.de> <20100228222702.GC29360@caradoc.them.org> <20100301103125.GB9730@calimero.vinschen.de> <20100301173054.GD5683@calimero.vinschen.de> <20100301193126.GA9416@caradoc.them.org> <83eik34vr8.fsf@gnu.org> <20100301215033.GB17815@caradoc.them.org> <20100302104358.GA26083@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100302104358.GA26083@calimero.vinschen.de> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2010-03/txt/msg00044.txt.bz2 On Tue, Mar 02, 2010 at 11:43:58AM +0100, Corinna Vinschen wrote: > The target specifies charset and wide charset. So we need two > target-specific variables. As I mentioned above, both variables would > replace the auto_target...charset variables. That makes sense. > How do I access the current gdbarch from show_target_charset_name, > show_target_wide_charset_name, and all the other functions in charset.c > which refer to the target charsets? >From the show functions, which are called by the CLI infrastructure, I think you're supposed to use get_current_arch (in arch-utils.h). >From other functions, mostly, you need the caller to pass an architecture. An increasing portion of GDB is parameterized this way. That'll work for e.g. target_wide_charset (). I don't think you can do either from _initialize_charset. That may have to happen lazily... -- Daniel Jacobowitz CodeSourcery