This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, testsuite] check for UTF-32 target wide charset support in gdb.base/wchar.exp


> 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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]