From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21556 invoked by alias); 1 Mar 2010 17:50:17 -0000 Received: (qmail 21540 invoked by uid 22791); 1 Mar 2010 17:50:16 -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; Mon, 01 Mar 2010 17:50:12 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id D934C6D42F5; Mon, 1 Mar 2010 18:50:09 +0100 (CET) Date: Mon, 01 Mar 2010 17:50: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: <20100301175009.GE5683@calimero.vinschen.de> Reply-To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org References: <20100228130500.GG5683@calimero.vinschen.de> <20100228142905.GB1556@caradoc.them.org> <20100228150318.GA32463@calimero.vinschen.de> <20100228184749.GA17375@caradoc.them.org> <20100228192159.GP5683@calimero.vinschen.de> <20100228222702.GC29360@caradoc.them.org> <20100301172052.GB32351@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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/msg00027.txt.bz2 On Mar 1 10:27, Tom Tromey wrote: > >>>>> "Daniel" == Daniel Jacobowitz writes: > > Daniel> On Mon, Mar 01, 2010 at 10:12:00AM -0700, Tom Tromey wrote: > Daniel> If the default becomes dependent on the target, we need to distinguish > Daniel> "user specified iso-8859-1" or "user didn't say anything, but now > Daniel> we're debugging i686-mingw32, and that usually uses cp1252". > > >> I think the ideal would be to extract this information from the > >> inferior. > > Daniel> I'm not sure I understand what you're suggesting... extract it how? > > I don't know :-) > > The only ways I can think of seem pretty fragile -- e.g., for POSIXy > systems, extract information from the inferior environment and reproduce > the C library logic. > > FWIW I think target-charset and target-wide-charset should be > per-inferior settings, like the environment and arguments. I haven't > looked into how to do that, though. I'm also not sure how that would > interact with an "auto" setting. I can't see any way to do that for an arbitrary target. Just Windows alone would be enough to get headaches. The default multibyte charset depends on the target application being a native Win32 application, or a Cygwin application. In the first case, the charset is the default ANSI codepage, in the latter case it's UTF-8, or the charset determined by the LC_ALL/LC_CTYPE/LANG environment variables. Corinna -- Corinna Vinschen Cygwin Project Co-Leader Red Hat