This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Fix wide char iconv problem on Solaris


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]