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



> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé?: Thursday, April 22, 2010 6:35 PM
> À?: Pierre Muller
> Cc?: gdb-patches@sourceware.org
> Objet?: Re: [RFC] Fix wide char iconv problem on Solaris
> 
> >>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
> writes:
> 
> Pierre>   The problem with OpenSolaris is that 'wchar_t' is not
> recognized as
> Pierre> a charset name.
> 
> Pierre>   The patch below tests
> Pierre> 'wchar_t', 'UTF32-LE' and finally host_charset ()
> Pierre> as entries for iconv_open.
> 
> Unfortunately, I think this approach can't work, because GDB uses
> things
> like iswprint to examine properties of the intermediate wide
> characters.
> So, the actual encoding of these characters matters.

  Maybe it's not ideal but for Solaris, it?s a big improvement.
Because without my patch all string displays fail,
while the work (at least for ascii chars) with it.
  Furthermore, looking into OpenSolaris sources,
iswprint seems to be a macro calling isprint...

> Last time this came up, I dug into Solaris libc a little, and my
> conclusion was that there is no fixed wchar_t encoding.  Instead it
> varies by locale.  Some of the possible wchar_t encodings appear not to
> have any corresponding name.
> 
> We could implement this by using the C library wide character
> conversion
> stuff ... but libiconv already does that for us.  My recommendation is
> that users who want Solaris to work properly ought to use libiconv, and
> we should disable wide character support on Solaris in other cases.

  How can we force disabling of wide char?
  Anyhow, the problem is that we should be able to
disable wide char use if iconv_open fails, not
at compile time only.
  Especially as I read in
http://www.gnu.org/software/libiconv/
That you can force use of gnu libiconv
after compilation using:
export LD_PRELOAD=/usr/local/lib/preloadable_libiconv.so

  
Pierre


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