This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Your INTERMEDIATE_ENCODING patch for Solaris
- From: Tom Tromey <tromey at redhat dot com>
- To: kazu at codesourcery dot com (Kazu Hirata)
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 05 Aug 2010 12:40:35 -0600
- Subject: Re: Your INTERMEDIATE_ENCODING patch for Solaris
- References: <20100731162500.32FAE5664F4@henry1.codesourcery.com>
>>>>> "Kazu" == Kazu Hirata <kazu@codesourcery.com> writes:
Kazu> We've been using a version of your patch posted at:
Kazu> http://sourceware.org/ml/gdb-patches/2009-07/msg00434.html
Kazu> except that we use
Kazu> #ifdef __sun__
Kazu> rather than
Kazu> #ifdef __STDC_ISO_10646__
Kazu> to special case for Solaris.
Kazu> As Andrew replied to your message above, __STDC_ISO_10646__ is not
Kazu> defined on Solaris. Could we use __sun__ instead?
I am not a Solaris expert, but some digging through the online
OpenSolaris libc sources a few months ago convinced me that the Solaris
wchar_t is in fact not UCS-4.
If that is true, then this patch would be incorrect.
My recollection is that if your locale's encoding was a stateful one,
then the Solaris wchar_t held the state in the high bits and the
character in the low bits; so I suppose this would be one way to try to
test to verify this hypothesis. A better way would be to check out the
libc and read through it oneself.
This particular problem has come up multiple times. I am not completely
sure what to do about it, but my current inclination is to change gdb so
that most hosts fall back to PHONY_ICONV, with exceptions for libiconv
and for Linux. This will at least have gdb default to working, and is
also attractive because I have some hope of actually testing it.
Tom