This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Fix wide char iconv problem on Solaris
- From: Tom Tromey <tromey at redhat dot com>
- To: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 23 Apr 2010 10:49:33 -0600
- Subject: Re: [RFC] Fix wide char iconv problem on Solaris
- References: <4856.53826403922$1271892634@news.gmane.org> <m38w8f78f5.fsf@fleche.redhat.com> <001201cae2b6$41776770$c4663650$@muller@ics-cnrs.unistra.fr>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> How can we force disabling of wide char?
All we need is for the logic in gdb_wchar.h to take the non-functioning
wchar_t branch. There are various ways this could be done.
This "degraded" functionality will still support different target
encodings, you just won't be able to display all the characters that
your terminal might support. Roughly, you're limited to ASCII display
-- so it is actually a little better than what GDB 6.8 provided, since
now you can at least print some wide strings.
Pierre> Anyhow, the problem is that we should be able to
Pierre> disable wide char use if iconv_open fails, not
Pierre> at compile time only.
You can try this, but I think it will necessitate a lot of code
duplication. You can't generally use iswprint on a char, only on a
wchar_t. For portability and standards conformance this is where you'd
have to do duplication. The conversion from char to wchar_t is not
guaranteed to be trivial.
If you really wanted to, you could extend the existing "phony iconv"
support to use the standard C conversion functions (e.g., wcrtomb).
Pierre> Especially as I read in
Pierre> http://www.gnu.org/software/libiconv/
Pierre> That you can force use of gnu libiconv
Pierre> after compilation using:
Pierre> export LD_PRELOAD=/usr/local/lib/preloadable_libiconv.so
I'd rather we not support this mode. It seems hard to use, and we
already know that on Solaris, libiconv is always preferable.
Tom