This is the mail archive of the
mailing list for the GDB project.
Re: displaying wchar_t in gdb
- From: Tom Tromey <tromey at redhat dot com>
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Cc: Klaus-Georg Adams <Klaus-Georg dot Adams at sap dot com>, gdb at sources dot redhat dot com
- Date: 29 Nov 2001 09:04:11 -0700
- Subject: Re: displaying wchar_t in gdb
- References: <Pine.SUN.3.91.1011129101817.10998J-100000@is>
- Reply-to: tromey at redhat dot com
>>>>> "Eli" == Eli Zaretskii <email@example.com> writes:
Eli> Risky assumptions, both of them (IMHO). For example, GDB can be
Eli> conceivably built with libiconv, but you cannot force the
Eli> debuggee to be built with it.
I don't think the debuggee would need iconv. GDB would fetch raw
bytes from the inferior, and then transform them to the appropriate
output encoding using the host iconv.
>> For wchar_t I don't think you need a new `print' format (well maybe to
>> specify the encoding). I think a wchar_t string could be printed
>> based solely on the type, the way we print a char* string right now.
Eli> I think you need a format because a buffer can be declared
Eli> `unsigned char *' even though it holds wide characters.
There's always `p (wchar_t *) buf'.
I already use this idiom with ordinary char* strings on occasion.