Hi!
It seems some further customization on the debugging script is needed, to make it possible to watch non-ASCII characters in unicode wxString in a huamn-readable way during debugging.
First, some links of related topics:
Custom Watch Script Pluggins
http://forums.codeblocks.org/index.php/topic,2097.0.htmlCan't see value of unicode strings while debugging
http://forums.codeblocks.org/index.php/topic,6587.15.htmlThe discussion about this in wxForum(I am the Utensil in the thread)
http://wxforum.shadonet.com/viewtopic.php?t=18136&highlight=I've read the topics and tried every way mentioned in them, I can watch ASCII characters in Unicode wxString, but I just can't watch non-ASCII characters, say, Chinese characters.
Then I tried to figure out why, I learned how the script works:
The function Evaluate_wxString returns a string which includes a gdb command, and make gdb to access to the corresponding memory and retrieve the characters, and output it.
The function Parse_wxString parses the output of gdb, and change it into a human-readable way.
At the beginning, I thought it's possible to let gdb output unicode characters, and found out that it doesn't support Unicdoe so far(see the thread in wxForum for details).
Then, I tried to hack it through Squirrel, but too few wxString functions has it binded.
An ugly way to watch it, is to make Evaluate_wxString return a calling command:
local msg = _T("call wxMessageBox(") + a_str + _T(",") + a_str + _T(",4,0)");
return msg;
It pops out a messagebox showing the wxString.
I do have a better idea, but it needs further support from Squirrel:
1) Let Evaluate_wxString make gdb output the characters in hexical format.
2) Use something like "\uxxxx" in C, to regenerate the unicode characters in a wxString, and let Parse_wxString return it, so Code::Blocks can show them in the right way...
The typeless and pointerless Squirrel seems not suit this job......
Any idea for a permanent solution?
Regards,
Utensil