This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Make string printing work on NetBSD (iconv issue)
- From: Tom Tromey <tromey at redhat dot com>
- To: Paul Koning <Paul_Koning at dell dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 07 May 2010 10:40:13 -0600
- Subject: Re: [RFC] Make string printing work on NetBSD (iconv issue)
- References: <19424.30941.651367.946330@pkoning-laptop.equallogic.com>
- Reply-to: tromey at redhat dot com
>>>>> "Paul" == Paul Koning <Paul_Koning@dell.com> writes:
Paul> The attached patch fixes this by having configure pick a suitable
Paul> codeset name to use. "wchar_t" is used if available, otherwise ucs-2
Paul> or ucs-4 with the appropriate byte order suffix is used instead.
This will yield incorrect results unless the chosen intermediate charset
is actually the one used for wchar_t.
Note that if this is the case for UCS-4, then your platform headers
ought to define __STDC_ISO_10646__. So, you could test that in
gdb_wchar.h rather than do any configury.
Alternatively, it is always safe to fall back to the code that uses
narrow intermediate characters and host_charset for the intermediate
encoding.
Perhaps this "wchar_t" thing is not the best way for us to go. Maybe
better would be to test __STDC_ISO_10646__ and fall back to narrow chars
in all other cases.
Other approaches are available too, but they are generally more work
than simply using GNU libiconv.
Tom