Re: [RFA] defs.h: Define GDB_DEFAULT_TARGET_[WIDE_]CHARSET for Cygwin and MingW builds

Daniel Jacobowitz
2010-02-28T14:29:14Z

On Sun, Feb 28, 2010 at 02:05:00PM +0100, Corinna Vinschen wrote:
> Hi,
>
> today I tested the wide char printing in GDB for the furst time on a
> Cygwin build and it didn't work well. The reson was that the default
> for GDB_DEFAULT_TARGET_WIDE_CHARSET is UTF-32, which is bad for a system
> defining wchar_t to be UTF-16. That's Windows for you.
>
> So I applied the below patch, which makes GDB for Cygwin happy. I also
> set the GDB_DEFAULT_TARGET_CHARSET for Cygwin and Win32 to a more sane
> default for both systems.
>
>
> Ok to apply?

No, this isn't right. __CYGWIN__ and _WIN32 are host checks, and
these charsets are target properties. So this will not have the
desired effect.

Hmm, does this mean these macros should become gdbarch properties?
That could be awkward in practice.

--
Daniel Jacobowitz
CodeSourcery