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: Doug Evans <xdje42 at gmail dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: sandra at codesourcery dot com, gdb-patches at sourceware dot org
- Date: Thu, 17 Sep 2015 21:36:46 -0700
- 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> <834mit7hrm dot fsf at gnu dot org>
Eli Zaretskii <eliz@gnu.org> writes:
>> 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.
Yikes. No, I didn't mean that. :-)
I meant have the PHONY_ICONV case use a better value for
GDB_DEFAULT_TARGET_WIDE_CHARSET.
>> 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?
By PHONY_ICONV.
[which is more of a minimal iconv than a phony iconv, but whatever]