From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24161 invoked by alias); 3 Mar 2010 17:22:26 -0000 Received: (qmail 24138 invoked by uid 22791); 3 Mar 2010 17:22:25 -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; Wed, 03 Mar 2010 17:22:20 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id C98566D42F5; Wed, 3 Mar 2010 18:22:17 +0100 (CET) Date: Wed, 03 Mar 2010 17:22:00 -0000 From: Corinna Vinschen To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds Message-ID: <20100303172217.GR17293@calimero.vinschen.de> Reply-To: gdb-patches@sourceware.org Mail-Followup-To: gdb-patches@sourceware.org, Tom Tromey 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> <20100303170645.GA23545@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100303170645.GA23545@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/msg00104.txt.bz2 On Mar 3 12:08, Daniel Jacobowitz wrote: > On Tue, Mar 02, 2010 at 03:55:08PM -0700, Tom Tromey wrote: > Or there may be some better way. Corinna, do you know? Is there some > other marker to distinguish a Cygwin executable besides linking to the > DLL? Not that I'm aware of, sorry. > Anyway, once you've got sniffers that distinguish Windows from Cygwin > binaries, the rest is easy. In the Windows implementation of > auto_charset, if GetACP is available, call it. That's not 100% right, > in that you could *theoretically* be debugging a Windows binary on a > remote system with a different charset, but it's all the work I think > we should do for a default. > > At this point, I think it's correct to call GetACP even for > a Cygwin GDB. The GDB might be a Cygwin executable but the program > being debugged might not be, and it will use the non-Cygwin > Windows settings. As one of the Cygwin maintainers I veto the notion to handle Cygwin as a Windows target in the first place. It's not valid to assume that Cygwin GDB is used to debug native apps and Cygwin apps are just an afterthought. And for Cygwin binaries the Windows default codepage has no meaning. The default codeset in Cygwin is UTF-8 and otherwise the same locale environment variables are used as other POSIX systems. Only the MingW GDB should default to the ANSI codepage. Cygwin should default to UTF-8. Corinna -- Corinna Vinschen Cygwin Project Co-Leader Red Hat