From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4579 invoked by alias); 3 Mar 2010 17:33:36 -0000 Received: (qmail 4555 invoked by uid 22791); 3 Mar 2010 17:33:35 -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; Wed, 03 Mar 2010 17:33:31 +0000 Received: (qmail 2352 invoked from network); 3 Mar 2010 17:33:29 -0000 Received: from unknown (HELO caradoc.them.org) (dan@127.0.0.2) by mail.codesourcery.com with ESMTPA; 3 Mar 2010 17:33:29 -0000 Date: Wed, 03 Mar 2010 17:33:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sourceware.org, Tom Tromey Subject: Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds Message-ID: <20100303173307.GA25653@caradoc.them.org> Mail-Followup-To: gdb-patches@sourceware.org, Tom Tromey References: <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> <20100303172217.GR17293@calimero.vinschen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100303172217.GR17293@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/msg00107.txt.bz2 On Wed, Mar 03, 2010 at 06:22:17PM +0100, Corinna Vinschen wrote: > 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. I don't understand why there's so much conflict about this! I'm not trying to treat Cygwin as an afterthought. And for an implementation, it is impossible to completely ignore that Cygwin binaries run on a Windows system. The point is to detect and handle Cygwin binaries correctly. Then we can give them a Cygwin code page, no matter whether GDB was built for mingw or cygwin. Both debuggers will handle both cases automatically, robustly, and correctly. We can not decide this at configure time; that defeats the point of multi-arch, a long term goal of GDB that we've finally achieved. I don't see why we can't do it right. I can dig up some code Pedro wrote that decodes the import table to check linked DLLs. I was hoping that there was an easier way using BFD, but BFD does not want to play nice. -- Daniel Jacobowitz CodeSourcery