This is the mail archive of the
mailing list for the GDB project.
Re: printing wchar_t*
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Vladimir Prus <ghost at cs dot msu dot su>
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 13 Apr 2006 19:15:34 +0300
- Subject: Re: printing wchar_t*
- References: <firstname.lastname@example.org>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Vladimir Prus <email@example.com>
> Date: Thu, 13 Apr 2006 20:04:32 +0400
> at the moment, gdb seem to provide no support for printing wchar_t* values.
> It prints them like this:
> (gdb) print p15
> print p15
> $486 = (wchar_t *) 0x80489f8
> Is there any "standard" way to make gdb automatically traverse wchar_t*,
> printing values, and stopping at '0' value.
What character set is used by the wide characters in the wchar_t
arrays? GDB has some support for a few single-byte character sets,
see the node "Character Sets" in the manual.
> I have a user-defined command that can produce the output I want, but is
> defining a custom command the right approach?
It's one possibility, the other one being to call a function in the
debuggee to produce the string. Yet another possibility is to do the
conversion in your GUI front end.