From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: Iconv / Solaris
Date: Thu, 27 Aug 2009 17:09:00 -0000 [thread overview]
Message-ID: <m3r5uxw5s6.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20090827020639.GA13935@caradoc.them.org> (Daniel Jacobowitz's message of "Wed, 26 Aug 2009 22:06:39 -0400")
>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> 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 <wchar.h>
#include <wctype.h>
--- 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 <wchar.h>
#include <wctype.h>
next prev parent reply other threads:[~2009-08-27 17:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-27 2:22 Daniel Jacobowitz
2009-08-27 17:09 ` Tom Tromey [this message]
2009-08-27 17:45 ` Daniel Jacobowitz
2009-08-27 20:36 ` Tom Tromey
2009-08-27 20:38 ` Daniel Jacobowitz
2009-08-27 20:50 ` Daniel Jacobowitz
2009-08-27 22:03 ` Daniel Jacobowitz
2009-08-28 1:01 ` Tom Tromey
2009-08-28 1:24 ` Tom Tromey
2009-08-28 17:00 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3r5uxw5s6.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox