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: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Tom Tromey'" <tromey at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 1 Sep 2010 09:30:11 +0200
- Subject: RE: Your INTERMEDIATE_ENCODING patch for Solaris
- References: <20100731162500.32FAE5664F4@henry1.codesourcery.com> <m37hk4x5r0.fsf@fleche.redhat.com> <m3eidxi069.fsf@fleche.redhat.com> <20100817184407.GC3599@adacore.com> <m3aaolgj0g.fsf@fleche.redhat.com> <20100818101406.GA2903@adacore.com> <15264.6257346079$1282142643@news.gmane.org> <m38w43dho9.fsf@fleche.redhat.com> <004b01cb3faf$b07ed580$117c8080$@muller@ics-cnrs.unistra.fr> <m34oeq8u1g.fsf@fleche.redhat.com> <m339twkmj5.fsf@fleche.redhat.com> <001b01cb48ee$6b8425f0$428c71d0$@muller@ics-cnrs.unistra.fr> <m3k4n6hgqe.fsf@fleche.redhat.com>
> -----Message d'origine-----
> De?: gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Tom Tromey
> Envoyé?: Tuesday, August 31, 2010 6:47 PM
> À?: Pierre Muller
> Cc?: gdb-patches@sourceware.org
> Objet?: Re: Your INTERMEDIATE_ENCODING patch for Solaris
>
> >>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>
> writes:
>
> Pierre> After searching, it appears that the problem comes from the
> fact
> Pierre> that /usr/local/include is searched before /usr/include,
> Pierre> while /usr/local/lib is not searched at all for libraries.
>
> Yuck.
>
> This setup seems unfortunate but I don't think there is much gdb should
> do about it.
I agree with you here :(
> Pierre> Test machine #3 x86_64 prcoessor:
> [...]
> Pierre> So this one uses c library iconv.
> Pierre> (top-gdb) p version
> Pierre> $1 = <error reading variable>
> Pierre> (top-gdb) inf fun iconv
> Pierre> All functions matching regular expression "iconv":
>
> Pierre> So here, the c library iconv functions are used,
> Pierre> but the default host-charset is set to ASCII which is
> Pierre> not handled by that iconv :(
>
> I am not sure how this happens with the patch I posted.
> Does this machine define __STDC_ISO_10646__?
> Or did I somehow get the #if logic wrong?
> Pierre> So I would like to have the default host and target
> Pierre> charset changed to UTF-8.
>
> What does nl_langinfo(CODESET) return on this sytem?
> If you remove the special "646" case, does it work?
the ASCII charset is indeed set by the check to
"646".
If I replace this by (only the "646" specific change is listed):
Index: charset.c
===================================================================
RCS file: /cvs/src/src/gdb/charset.c,v
retrieving revision 1.34
diff -u -p -r1.34 charset.c
--- charset.c 24 Jun 2010 18:24:03 -0000 1.34
+++ charset.c 1 Sep 2010 07:28:23 -0000
@@ -928,7 +931,9 @@ _initialize_charset (void)
/* Solaris will return `646' here -- but the Solaris iconv then
does not accept this. Darwin (and maybe FreeBSD) may return "" here,
which GNU libiconv doesn't like (infinite loop). */
- if (!strcmp (auto_host_charset_name, "646") || !*auto_host_charset_name)
+ if (!strcmp (auto_host_charset_name, "646"))
+ auto_host_charset_name = "UTF-8";
+ else if (!*auto_host_charset_name)
auto_host_charset_name = "ASCII";
auto_target_charset_name = auto_host_charset_name;
#elif defined (USE_WIN32API)
I do get a default of '"UTF-8" for Open Solaris machines,
but I don't know if other systems might also return "646",
but not like the "UTF-8" choice.
In any case, having a LANG environment variable set to xx_XX.UTF-8
also allows to get a nicely working gdb.
Pierre