From: Tom Tromey <tromey@redhat.com>
To: "Paul Koning" <Paul_Koning@Dell.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [RFC] Make string printing work on NetBSD (iconv issue)
Date: Fri, 07 May 2010 22:46:00 -0000 [thread overview]
Message-ID: <m3sk63e3ee.fsf@fleche.redhat.com> (raw)
In-Reply-To: <D8CEBB6AE9D43848BD2220619A43F3265BD0B3@M31.equallogic.com> (Paul Koning's message of "Fri, 7 May 2010 13:25:50 -0400")
>>>>> "Paul" == Paul Koning <Paul_Koning@Dell.com> writes:
Paul> It clearly can't make matters worse, because any platform that doesn't
Paul> have the codeset name "wchar_t" currently doesn't work at all.
I think it is worse in one sense, which is that the results can be
incorrect with no warning. In particular I believe this could happen on
Solaris in some locales.
I do see your point though. Completely failing is terrible.
Paul> NetBSD clearly is using UCS-4 for wchar_t, but it does not define that
Paul> symbol.
Bummer.
Yet another idea would be host-specific overrides for INTERMEDIATE_ENCODING.
Tom> Alternatively, it is always safe to fall back to the code that uses
Tom> narrow intermediate characters and host_charset for the intermediate
Tom> encoding.
Paul> Yes, but doesn't that mean you end up not being able to accurately print
Paul> a wide string if one occurs in your program -- because it gets mapped to
Paul> the intermediate encoding first and with narrow chars for intermediate
Paul> coding you have a lossy translation?
Nope, there is code in gdb to handle this. You will see escape
sequences for any unprintable or untranslatable characters. The only
problem is just that more characters are considered to be unprintable in
this scenario; roughly speaking this gets you back to what gdb 6.8 would
do.
Tom> Other approaches are available too, but they are generally more work
Tom> than simply using GNU libiconv.
Paul> Right, if you use libiconv then the issue goes away, and the patch I
Paul> wrote should handle that case cleanly. I wanted to offer a solution to
Paul> people who don't want to install libiconv because they have a functional
Paul> iconv in libc, as is the case for NetBSD.
Another possible approach is to choose a known intermediate
representation, say UTF-32. Then, provide gdb-specific replacements for
the various wide functions that are needed: wcslen, iswprint, iswdigit,
btowc.
Tom
next prev parent reply other threads:[~2010-05-07 22:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-04 19:43 Paul Koning
2010-05-04 20:01 ` Andreas Schwab
2010-05-04 20:06 ` Paul Koning
2010-05-07 16:40 ` Tom Tromey
2010-05-07 17:26 ` Paul Koning
2010-05-07 22:46 ` Tom Tromey [this message]
2010-05-10 21:25 ` Paul Koning
2010-05-19 15:11 ` Tom Tromey
2010-05-19 15:25 ` Paul Koning
2010-05-19 15:30 ` Tom Tromey
2010-05-19 18:23 ` Paul Koning
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=m3sk63e3ee.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=Paul_Koning@Dell.com \
--cc=gdb-patches@sourceware.org \
/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