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: Fri, 17 Sep 2010 13:48:00 -0000	[thread overview]
Message-ID: <001101cb5663$f6011c10$e2035430$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <m3y6b1nmn2.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é : Friday, September 17, 2010 4:13 AM
> À : 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>   Would it be possible to test an old libiconv on some other
> platform?
> 
> I can't do this any time soon, but according to the libiconv NEWS file,
> this feature was added in 1.5.  So, perhaps we can relax the version
> check to 0x105.

  I found the libiconv version 1.5
installed it on a x86 Open Solaris machine,
modified gdb_wchar.h to use _LIBICONV_VERSION >= 0x105
and got an gdb executable linked to libiconv version 1.5,
using --with-libiconv-prefix=/usr/local/src/test32
(the installation prefix I used for 1.5 libiconv).

  I tested charset.exp result on that executable,
and got a lot of failures:
                === gdb Summary ===

# of expected passes            68
# of unexpected failures        51
/usr/local/src/gdb/build32/gdb/testsuite/../../gdb/gdb version  7.2.50.20100916-
cvs -nw -nx

  while using 1.13.1 libiconv version, I got this:
                === gdb Summary ===

# of expected passes            159
# of unexpected failures        2

  But I was wondering if the problem is not coming from the
fact that for 1.5 libiconv find_charset_names function
directly calls 'iconv -l' (because iconvlist is not present
in this version of the library).
  The iconv that is called is the /usr/bin/iconv
not the one that comes with the installed library:
/usr/local/src/test32/bin/iconv.

  On the other hand, as iconvlist function is
not implemented in 1.5 version
'iconv -l' also doesn't work.
  This makes me believe that we should not attempt to
call 'iconv -l' if we link in GNU libiconv and no
iconvlist function exists.
  The list that is read in by 'iconv -l' call is the list
of libc iconv supported charsets in a format that is
mishandled by the code anyhow:
(top-gdb) set charset
gives this:
Requires an argument. Valid arguments are auto, fromcode-tocode., Some, of, those, 
code, set, names, have, aliases, which, are, case-insensitive, and, described, in, 
parentheses, following, the, canonical, name:, 5601, 646, (ASCII, US-ASCII
, US_ASCII, USASCII), 646da, 646de, 646en, 646es, 646fr, 646it, 646sv, 8859, 885
9-1, (ISO8859-1, ISO-8859-1, ISO8859_1, ISO_8859_1), 8859-10, (ISO8859-10, ISO88
(.... the list is much longer,)
 The output of the libc iconv is not parsed correctly
because aliases are within parenthesis that are not removed
and an introduction sentence is not recognized.

(top-gdb) set charset ASCII
Undefined item: "ASCII".
(top-gdb) set charset (ASCII
Cannot convert between character sets `UTF-32' and `(ASCII'
(top-gdb) set charset US_ASCII
Cannot convert between character sets `UTF-32' and `US_ASCII'
(top-gdb) set charset US-ASCII
(top-gdb) p version
$1 = "7.2.50.20100916-cvs"

So you can see:
 'ASCII' is refused by GDB because not in the 'wrong' list it
created by 'iconv -l' call.
 '(ASCII' is accepted by GDB, but refused by iconv_open
 'US_ASCII' is accepted by GDB, but refused by iconv_open,
probably because 1.5 GNU libiconv does not recognize that alias,
whereas 'US-ASCII' is accepted by GDB, and by iconv_open!

  That would mean that we should either:
 1) only accept libiconv if it also has iconvlist (1.8 already has iconvlist,
but there are some changes recorded in the ChangeLog after that).

or
 2) not call 'iconv -l' if libiconv has no iconvlist function
and use only the standard list defined.

  I also downloaded version 1.8 of libiconv,
and checked GDB linked to that version:
the results of charset.exp are the same as 1.13.1 (2 FAILs)

Pierre

PS: Support of libc iconv for Solaris could probably be 
enhanced by a better parsing of 'iconv -l' output...


  reply	other threads:[~2010-09-17 12:29 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
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 [this message]
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='001101cb5663$f6011c10$e2035430$@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).