This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch, testsuite] check for UTF-32 target wide charset support in gdb.base/wchar.exp
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Doug Evans <xdje42 at gmail dot com>
- Cc: sandra at codesourcery dot com, gdb-patches at sourceware dot org
- Date: Thu, 17 Sep 2015 08:10:37 +0300
- Subject: Re: [patch, testsuite] check for UTF-32 target wide charset support in gdb.base/wchar.exp
- Authentication-results: sourceware.org; auth=none
- References: <55FA325D dot 1020207 at codesourcery dot com> <m3k2rpsm4p dot fsf at sspiff dot org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Doug Evans <xdje42@gmail.com>
> Cc: gdb-patches <gdb-patches@sourceware.org>
> Date: Wed, 16 Sep 2015 21:30:46 -0700
>
> #undef GDB_DEFAULT_HOST_CHARSET
> #define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1"
> #define GDB_DEFAULT_TARGET_CHARSET "ISO-8859-1"
> #define GDB_DEFAULT_TARGET_WIDE_CHARSET "ISO-8859-1" <<<<
>
> How reasonable is it to enhance the PHONY_ICONV support so that
> it handles this better?
You mean, have functions like strlen and strcat handle 32-bit wchar_t
strings? Not reasonable.
> I see it already tries to provide some minimal functionality:
>
> static iconv_t
> phony_iconv_open (const char *to, const char *from)
> {
> /* We allow conversions from UTF-32BE, wchar_t, and the host charset.
> We allow conversions to wchar_t and the host charset. */
> if (strcmp (from, "UTF-32BE") && strcmp (from, "wchar_t")
> && strcmp (from, GDB_DEFAULT_HOST_CHARSET))
> return -1;
> if (strcmp (to, "wchar_t") && strcmp (to, GDB_DEFAULT_HOST_CHARSET))
> return -1;
>
> /* Return 1 if we are converting from UTF-32BE, 0 otherwise. This is
> used as a flag in calls to iconv. */
> return !strcmp (from, "UTF-32BE");
> }
>
> I don't know, off hand, why big endian is supported and not little endian.
Supported by whom?