List Info

Thread: printing wchar_t*




printing wchar_t*
user name
2006-04-13 16:15:34
> From:  Vladimir Prus <ghostcs.msu.su>
> 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.
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )