From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 765 invoked by alias); 2 Mar 2010 10:44:08 -0000 Received: (qmail 744 invoked by uid 22791); 2 Mar 2010 10:44:07 -0000 X-Spam-Check-By: sourceware.org Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Tue, 02 Mar 2010 10:44:01 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 6B2126D42F5; Tue, 2 Mar 2010 11:43:58 +0100 (CET) Date: Tue, 02 Mar 2010 10:44:00 -0000 From: Corinna Vinschen To: gdb-patches@sourceware.org Subject: Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds Message-ID: <20100302104358.GA26083@calimero.vinschen.de> Reply-To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org References: <20100228184749.GA17375@caradoc.them.org> <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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100301215033.GB17815@caradoc.them.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes 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/msg00042.txt.bz2 On Mar 1 16:50, Daniel Jacobowitz wrote: > On Mon, Mar 01, 2010 at 10:44:43PM +0200, Eli Zaretskii wrote: > > It sounds like, for cross debugging, the only fair default is ASCII. > > That way, each user will have to set the right target charset, and no > > one will feel they are children of a lesser god. > > This is a target specific setting. Why is there so much resistance to > making the target set the property? This is how we handle lots of our > other global and target-related state. > > There's a function, target_wide_charset. It is currently passed a > byte order, and consults various globals. It should be passed a > gdbarch instead of a byte order, which will require some refactoring > but nothing major from my inspection. That's one straightforward > patch. > > target_wide_charset_name can not currently be set to auto. That > should be allowed, and the default; if it is "auto", then it should > be returned (and "show target-wide-charset" too) as > GDB_DEFAULT_TARGET_WIDE_CHARSET. Just like host_charset_name / > auto_host_charset name. That's another straightforward patch. This, as well as the same for target_charset_name was already in my previous patch. But I don't see a reason to keep the auto_target_wide_charset_name and auto_target_charset_name variables since they would be entirely replaced by the gdbarch equivalent... > Then, GDB_DEFAULT_TARGET_WIDE_CHARSET can become a gdbarch variable. > The gdbarch created in i386_cygwin_init_abi can set it to the right > thing. The default can be what it is now. This patch is less > straightforward because of the existing hacks, like PHONY_ICONV. 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. I know how to change gdbarch.sh to add the variables, and I have all the other stuff almost in place. But I have a problem. 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? Corinna -- Corinna Vinschen Cygwin Project Co-Leader Red Hat