printing wchar_t*

Vladimir Prus
2006-04-13T16:04:56Z

Hi,
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. I don't care much how it's
actually printed, for example, printing raw hex values will work:

0x56, 0x1456

or using \u escapes:

'test\u1234'

or whatever.

I have a user-defined command that can produce the output I want, but is
defining a custom command the right approach?

- Volodya