Author Topic: Request feature to watch non-ASCII characters in wxString during debugging  (Read 8159 times)

Offline Utensil

  • Single posting newcomer
  • *
  • Posts: 4
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.html

Can't see value of unicode strings while debugging http://forums.codeblocks.org/index.php/topic,6587.15.html

The 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:

Code
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

« Last Edit: March 06, 2008, 01:43:35 am by Utensil »

Offline Utensil

  • Single posting newcomer
  • *
  • Posts: 4
So there's nobody who has any comments on this? This thread is posted for a long time... :(
Any responce or idea or experience share will be greatly appreciated...

-Utensil

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Quote
Any idea for a permanent solution?

You have to be patient and wait. The debugger plugin is being mildly refactored (in my local copy) to address these as well as some other issues.
Be patient!
This bug will be fixed soon...

Offline Utensil

  • Single posting newcomer
  • *
  • Posts: 4
Hi mandrav,


You have to be patient and wait. The debugger plugin is being mildly refactored (in my local copy) to address these as well as some other issues.

Thanks for the rapid reply! Just knowing that this feature is work-in-progress, I'll be very gratified :D I asked it just for other C::B users hoping this feature request is noted by the developers of C::B.

I'm just a fan of C::B, in the great suprise and adoration of the versatility and completeness of C::B. And it's my pleasure to meet you, a project leader of C::B  :P

Just two more questions, can you give me an approximate estimation of the commit time of this part of patch( months is also OK for me)? And is there any related discussions on this forum that I didn't noticed?

Regards,

Utensil
« Last Edit: April 18, 2008, 09:54:20 am by Utensil »

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Just two more questions, can you give me an approximate estimation of the commit time of this part of patch( months is also OK for me)? And is there any related discussions on this forum that I didn't noticed?

No, I started working on it before the 8.02 release but still haven't finished due to lack of time. That's why I also can't give an estimate: it really depends on the free time I manage to find. It could be finished in few days or few months. Really can't say atm...
Be patient!
This bug will be fixed soon...

Offline Utensil

  • Single posting newcomer
  • *
  • Posts: 4
No problem, I'm not in a hurry :)  When you finished it, would you please drop a note here? Then I'll be notified by a mail.

Thanks for all your efforts and time previously,

Utensil