From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28048 invoked by alias); 28 Feb 2010 15:03:27 -0000 Received: (qmail 27902 invoked by uid 22791); 28 Feb 2010 15:03: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; Sun, 28 Feb 2010 15:03:20 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 2BF886D42F5; Sun, 28 Feb 2010 16:03:18 +0100 (CET) Date: Sun, 28 Feb 2010 15:03: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: <20100228150318.GA32463@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100228142905.GB1556@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-02/txt/msg00675.txt.bz2 On Feb 28 09:29, Daniel Jacobowitz wrote: > On Sun, Feb 28, 2010 at 02:05:00PM +0100, Corinna Vinschen wrote: > > Hi, > > > > today I tested the wide char printing in GDB for the furst time on a > > Cygwin build and it didn't work well. The reson was that the default > > for GDB_DEFAULT_TARGET_WIDE_CHARSET is UTF-32, which is bad for a system > > defining wchar_t to be UTF-16. That's Windows for you. > > > > So I applied the below patch, which makes GDB for Cygwin happy. I also > > set the GDB_DEFAULT_TARGET_CHARSET for Cygwin and Win32 to a more sane > > default for both systems. > > > > > > Ok to apply? > > No, this isn't right. __CYGWIN__ and _WIN32 are host checks, and > these charsets are target properties. So this will not have the > desired effect. > > Hmm, does this mean these macros should become gdbarch properties? > That could be awkward in practice. I don't know because I don't know the affected code good enough, but as it is now, the code doesn't work on Cygwin, and probably on no UTF-16 target. If the codeset is target-specific anyway, then the idea of the GDB_DEFAULT_TARGET_WIDE_CHARSET and GDB_DEFAULT_TARGET_CHARSET variables is either wrong, or it must be possible to define them somewhere on a per-target base. What about windows-tdep.h? Corinna -- Corinna Vinschen Cygwin Project Co-Leader Red Hat