public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: "'Tom Tromey'" <tromey@redhat.com>
Cc: <gdb-patches@sourceware.org>
Subject: RE: Your INTERMEDIATE_ENCODING patch for Solaris
Date: Tue, 31 Aug 2010 09:25:00 -0000	[thread overview]
Message-ID: <001b01cb48ee$6b8425f0$428c71d0$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <m339twkmj5.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é : Monday, August 30, 2010 8:01 PM
> À : Pierre Muller
> Cc : gdb-patches@sourceware.org
> Objet : Re: Your INTERMEDIATE_ENCODING patch for Solaris
> 
> >>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
> 
> Tom> Here's a new version that should disable iconv on this platform,
> among
> Tom> others.
> 
> Hi Pierre.  Did this patch work for you?

  Hi Tom,
  sorry for the delay:

  here are a few results:

Test machine #1: 
uname -a output:
SunOS opensolaris 5.11 snv_111b i86pc i386 i86pc Solaris

With your patch, gdb compiles fine, 

gdbcvs/build-norm/gdb$ grep ICONV *.h
config.h:#define HAVE_ICONV 1
config.h:/* #undef HAVE_ICONVLIST */
config.h:/* #undef HAVE_LIBICONVLIST */
config.h:#define ICONV_CONST const

./gdb ./gdb
(top-gdb) p version
$1 = "7.2.50.20100831-cvs"

after replacing \r\n by \r+\n in charset.exp, I get:
.../gdb/testsuite$ gmake check RUNTESTFLAGS=charset.exp
                === gdb Summary ===

# of expected passes            111
# of unexpected failures        50
(Do you want the detailed output?)

(Without patch, but the same modified charset.exp,
the printing of version fails
I get:
                === gdb Summary ===

# of expected passes            74
# of unexpected failures        87
)

Test machine #2: 
uname -a output:
uname -a
SunOS muller 5.11 snv_111b sun4v sparc SUNW,Sun-Fire-T200 Solaris
gdb/buildcvs/gdb$ ./gdb ./gdb
(top-gdb) p version
$1 = "7.2.50.20100831-cvs"
(top-gdb) inf func iconv
All functions matching regular expression "iconv":

File ../../src/gdb/charset.c:
size_t phony_iconv(int, const char **, size_t *, char **, size_t *);
int phony_iconv_close(int);
int phony_iconv_open(const char *, const char *);
static void cleanup_iconv(void *);
(top-gdb) q
:/gdb/buildcvs/gdb$ grep ICONV *.h
config.h:/* #undef HAVE_ICONV */
config.h:/* #undef HAVE_ICONVLIST */
config.h:/* #undef HAVE_LIBICONVLIST */
config.h:/* #undef ICONV_CONST */

So apparently on Sparc, the C library iconv is not found,
despite the fact that it is in libc.so:
/lib$ objdump -T libc.so |grep iconv
0005f768 g    DF .text  00000034  SUNW_0.8    .protected iconv
0005f6e8 g    DF .text  00000080  SUNW_0.8    .protected iconv_close
0005f000 g    DF .text  000000b4  SUNW_0.8    .protected iconv_open

  After searching, it appears that the problem comes from the fact
that /usr/local/include is searched before /usr/include,
while /usr/local/lib is not searched at all for libraries.

 /usr/local/include/iconv.h contains the /usr/local/lib/libiconv.so
header.
  Compilation without -liconv fails because
/usr/local/include/iconv.h has:
#define iconv libiconv
but libiconv is not found in c library.
 and the second compilation with "-liconv" option fails
because /usr/local/lib is not in the library search path.
  Ugly, no?
For that machine, the output did not change as none of the
ICONV macros are set.

Test machine #3 x86_64 prcoessor:
uname -a
SunOS muller 5.11 snv_111b i86pc i386 i86pc Solaris
gdb/build-64/gdb$ grep ICONV *.h
config.h:#define HAVE_ICONV 1
config.h:/* #undef HAVE_ICONVLIST */
config.h:/* #undef HAVE_LIBICONVLIST */
config.h:#define ICONV_CONST const

So this one uses c library iconv.
(top-gdb) p version
$1 = <error reading variable>
(top-gdb) inf fun iconv
All functions matching regular expression "iconv":

File ../../src/gdb/charset.c:
static void cleanup_iconv(void *);

Non-debugging symbols:
0x0000000000514860  iconv_open
0x0000000000514860  iconv_open@plt
0x0000000000514870  iconv_close
0x0000000000514870  iconv_close@plt
0x0000000000514880  iconv
0x0000000000514880  iconv@plt
(top-gdb) set host-charset UTF-8
(top-gdb) p version
$2 = "7.2.50.20100831-cvs"

 So here, the c library iconv functions are used,
but the default host-charset is set to ASCII which is 
not handled by that iconv :(

So I would like to have the default host and target 
charset changed to UTF-8.

It is of course possible to use:
gdb/build-64/gdb$ export LANG=en_US.UTF-8
in that case, the defaults are set correctly:
(top-gdb) p version
$1 = "7.2.50.20100831-cvs"
(top-gdb) show charset
The host character set is "auto; currently UTF-8".
The target character set is "auto; currently UTF-8".
The target wide character set is "auto; currently UTF-32".

  But I would still prefer if we changed also the default
to UTF-8 for solaris.

Pierre

  reply	other threads:[~2010-08-31  9:25 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-31 16:25 Kazu Hirata
2010-08-05 18:40 ` Tom Tromey
2010-08-10 20:28   ` Daniel Jacobowitz
2010-08-17 18:06   ` Tom Tromey
2010-08-17 18:44     ` Joel Brobecker
2010-08-17 19:03       ` Tom Tromey
2010-08-18 10:14         ` Joel Brobecker
2010-08-18 14:43           ` Pierre Muller
2010-08-18 14:52             ` Joel Brobecker
2010-08-18 15:10               ` Pierre Muller
2010-08-18 15:35               ` Tom Tromey
2010-08-18 15:44           ` Tom Tromey
2010-08-18 16:36             ` Joel Brobecker
2010-08-18 17:35               ` Tom Tromey
2010-08-18 17:41                 ` Joel Brobecker
     [not found]           ` <15264.6257346079$1282142643@news.gmane.org>
2010-08-18 16:12             ` Tom Tromey
2010-08-19 15:03               ` Pierre Muller
2010-08-19 16:09                 ` Tom Tromey
2010-08-30 18:01                   ` Tom Tromey
2010-08-31  9:25                     ` Pierre Muller [this message]
2010-08-31 16:47                       ` Tom Tromey
2010-09-01  7:30                         ` Pierre Muller
     [not found]                         ` <44796.6229789474$1283326243@news.gmane.org>
2010-09-01 22:35                           ` Tom Tromey
2010-09-02 14:21                             ` Pierre Muller
2010-09-02 15:39                               ` Tom Tromey
2010-09-14 21:29                                 ` Tom Tromey
2010-09-15 17:20                                   ` Pierre Muller
2010-09-16  7:55                                     ` Tom Tromey
2010-09-16  9:49                                       ` Pierre Muller
2010-09-16 20:22                                         ` Tom Tromey
2010-09-16 22:31                                           ` Pierre Muller
     [not found]                                           ` <20078.2261243605$1284672670@news.gmane.org>
2010-09-17  9:21                                             ` Tom Tromey
2010-09-17 13:48                                               ` Pierre Muller
2010-09-23 13:00                                                 ` Tom Tromey
2010-09-23 14:48                                                   ` Pierre Muller
2010-09-27 18:42                                                     ` Tom Tromey
2010-09-16 17:51                                       ` [patch] Regression on py-prettyprint.exp: print estring [Re: Your INTERMEDIATE_ENCODING patch for Solaris] Jan Kratochvil
2010-09-16 20:33                                         ` Tom Tromey
2010-09-16 20:44                                           ` Jan Kratochvil
2010-08-18 11:52         ` Your INTERMEDIATE_ENCODING patch for Solaris Pierre Muller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='001b01cb48ee$6b8425f0$428c71d0$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).