Display the value of wchar_t strings.
A small testprogram widechar.cpp is included in the directory testprogs.
The patch does the following:
The values of variables of type "wchar_t*" (as well as "const wchar_t*")
ar displayed analogous to "char*". I have used your implementations of
handlePrint methods as guidelines and implemented it the same way. When
a variable of type "wchar_t*" is found, then its contents is requested
from GDB and the resulting array is displayed as string.
Limitations:
Unfortunately, this does not work for arrays of wchar_t. A tip how this
could be done is appreciated.
If there are invalid pointers, then the function wcslen, which is used
internally, crashes. But GDB handles this correctly and there are no
problems (at least for me).
It is assumed that wchart_t and QChar contain the same characters.
At least this is the case for me, and as far as I understand this topic,
this should be ok generally.
[J6t: Actually, no. There is no guarantee that wchar_t contains Unicode
characters. But for all practical purposes, the assumption should be valid.]