From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11538 invoked by alias); 27 Aug 2009 17:01:06 -0000 Received: (qmail 11440 invoked by uid 22791); 27 Aug 2009 17:01:05 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Aug 2009 17:00:55 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n7RH0q4s010884 for ; Thu, 27 Aug 2009 13:00:53 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n7RH0h8H016307; Thu, 27 Aug 2009 13:00:51 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n7RH0gaa022653; Thu, 27 Aug 2009 13:00:42 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 127DD3782A9; Thu, 27 Aug 2009 11:00:42 -0600 (MDT) From: Tom Tromey To: gdb-patches@sourceware.org Subject: Re: Iconv / Solaris References: <20090827020639.GA13935@caradoc.them.org> Reply-To: Tom Tromey Date: Thu, 27 Aug 2009 17:09:00 -0000 In-Reply-To: <20090827020639.GA13935@caradoc.them.org> (Daniel Jacobowitz's message of "Wed, 26 Aug 2009 22:06:39 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2009-08/txt/msg00486.txt.bz2 >>>>> "Daniel" == Daniel Jacobowitz writes: Daniel> Just confirming what I said on IRC: __STDC_ISO_10646__ is not defined Daniel> anywhere, but with __sun__ your patch from here: Daniel> http://sourceware.org/ml/gdb-patches/2009-07/msg00434.html Daniel> fixes an otherwise broken GDB on Solaris. I think UCS-4 is right, but Daniel> the Solaris documentation isn't clear; maybe it would be clear if I Daniel> understood wide characters better. Daniel> Actually, poking around the internet, it looks like wchar_t's contents Daniel> may be locale-dependent... Yeah :-( I did a little digging on various sun.com sites, and all I could find is that wchar_t will be UCS-4 if the current locale is using UTF-8. That is not a very strong guarantee -- it means that GDB might work for some users but not others, if there are locales where wchar_t is not UCS-4. The very safest thing to do is disable use of wchar_t on a platform like this. E.g., the appended hack can be used to try it. This will provide a user experience similar to GDB 6.8. Alternatively, you could try using the __sun__ variant and running gdb in a non-UTF-8 locale. If it works we could go with (a variant of) this approach. Finally, I looked at libiconv-1.13. It also supports converting to the "wchar_t" encoding using mbrtowc, if that is available. I guess it must perform an intermediate conversion. Maybe using libiconv on Solaris would provide a better experience for your users. Tom *** gdb_wchar.h.~1.2.~ 2009-04-15 15:59:05.000000000 -0600 --- gdb_wchar.h 2009-08-27 10:31:01.000000000 -0600 *************** *** 47,53 **** /* We use "btowc" as a sentinel to detect functioning wchar_t support. */ ! #if defined (HAVE_ICONV) && defined (HAVE_WCHAR_H) && defined (HAVE_BTOWC) #include #include --- 47,53 ---- /* We use "btowc" as a sentinel to detect functioning wchar_t support. */ ! #if defined (HAVE_ICONV) && defined (HAVE_WCHAR_H) && defined (HAVE_BTOWC) && !defined (__sun__) #include #include