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

Tom Tromey
2010-03-02T17:59:02Z

>>>>> "Daniel" == Daniel Jacobowitz <dan@codesourcery.com> writes:

>> Personally, I think that, given the existing nl_langinfo code (and
>> worse, Solaris hack) in _initialize_charset, it would be fine to add
>> some Cygwin change here. However, I won't approve a patch like that
>> over Daniel's objections.

Daniel> I don't mind hacks in general. I do mind hacks that are going to
Daniel> break my currently working builds. If you build an i686-mingw32
Daniel> to arm-linux debugger, and suddenly that defaults to UTF-16 instead of
Daniel> UCS-4, then I've got a problem.

Yes, I see what you mean. Sorry for being so dense.

Additionally, you're currently exposed to this scenario in the situation
where Corinna decides to fix the problem by implementing
nl_langinfo(CODESET) in Cygwin ;-)

Daniel> What do you suggest?

I agree, we need a gdbarch method.

Perhaps we should also extend the current "-BE/-LE" hack to look at the
width of wchar_t in the user's program. That is, "set
target-wide-charset auto" (or perhaps "auto-utf") would select between
UTF-16/32/-BE-LE as appropriate.

I'll look into this today.

Tom