public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Patrick Monnerat <patrick@monnerat.net>
To: Tom Tromey <tom@tromey.com>,
	Patrick Monnerat via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] gdb: add UTF16/UTF32 target charsets in phony_iconv
Date: Sat, 8 Oct 2022 02:12:02 +0200	[thread overview]
Message-ID: <0a978271-3085-8bf3-f5fd-6a0b3f9f3ea2@monnerat.net> (raw)
In-Reply-To: <87k05bs8c5.fsf@tromey.com>


On 10/7/22 22:10, Tom Tromey wrote:
>>>>>> "Patrick" == Patrick Monnerat via Gdb-patches <gdb-patches@sourceware.org> writes:
Many thanks for your review and remarks.
> Patrick> Function phony_iconv is substituted to the system-supplied iconv on
> Patrick> platforms where the latter is deficient.
>
> I sort of hate to improve the phony iconv, but I get why one might want
> to.

Me too! In fact, I even hate the idea of phony_iconv: this is just a 
workaround for a particular case of unreliable external component.

Conversions to UTF-32 were probably not needed/mandatory when 
phony_iconv was implemented. This is not the case anymore and a true 
workaround should now support them.

>
> Patrick> Conditonal statements decide when the substitution occurs. This
> Patrick> currently enables it for mingw (wchar_t is not UTF-32) even when the
> Patrick> system-supplied iconv is suitable for gdb use.
>
> I don't recall the outcome from this, but is there no way to improve gdb
> to use this iconv?  If it truly works well enough then it seems like it
> would be the better approach.

There is a fuzzy source comment about an iconv problem in Solaris. Your 
bugzilla comment 
https://sourceware.org/bugzilla/show_bug.cgi?id=29315#c2 also goes in 
this direction: however we have no details about what the problem is, if 
we should still support it and/or if there are other systems affected by 
such an iconv problem.

Conditionals enabling phony_iconv rely on ISO-10646 availability (32-bit 
wchar_t?), Haible's implementation of iconv and/or btowc availability, 
but not on a particular OS (see gdb_wchar.h). This is very hard to 
establish a relation between the conditionals and what the implementor 
wanted to target.

In the absence of further info, this patch goes the safe way and 
probably resolves UTF-32 problems on some platforms. Ideally, 
phony_iconv should be removed if the problem has not to be supported 
anymore. Else, conditionals targeting the faulty cases (but what are 
they?) rather than the working ones would be preferable. If we have to 
keep phony_iconv, it should be able to support conversions to UTF-32 anyway.


Please note I had the intention to determine the Solaris problem and 
tried to install the last available OpenSolaris (dated 2009) in a VM 
without success: I gave up.

Patrick


  reply	other threads:[~2022-10-08  0:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-02 14:00 Patrick Monnerat
2022-10-07 20:10 ` Tom Tromey
2022-10-08  0:12   ` Patrick Monnerat [this message]
2022-10-08 18:55     ` Tom Tromey
2022-10-09  0:47       ` Patrick Monnerat
2022-10-10 16:11         ` Tom Tromey
2022-10-16  1:50           ` Tom Tromey
2022-10-16  6:24             ` Eli Zaretskii
2022-10-17 23:10               ` Tom Tromey

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=0a978271-3085-8bf3-f5fd-6a0b3f9f3ea2@monnerat.net \
    --to=patrick@monnerat.net \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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).