Author Topic: Debugger settings for wxWidgets?  (Read 4544 times)

Offline MyMindsAvatar

  • Multiple posting newcomer
  • *
  • Posts: 13
Debugger settings for wxWidgets?
« on: October 31, 2010, 09:29:55 am »
Hi everyone,

I currently running C::B svn 6784 on Ubuntu Lucid Lynx with a wxWidgets GUI (v2.9.1), but I need some help configuring the default debugger (GNU gdb (GDB) 7.1-ubuntu) to display the wx objects in a more meaningful way. I'm assuming this is a configuration issue because I can find most of the information I'm after but through various class members (e.g. the value held in a wxString variable is found in _M_p in _M_dataplus in m_impl), rather than just being displayed as "text".

If anyone can offer any advice on how to get the correct display of variable information, I would be very grateful.

Many thanks,

Richard ~
« Last Edit: October 31, 2010, 09:38:45 am by MyMindsAvatar »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger settings for wxWidgets?
« Reply #1 on: October 31, 2010, 10:09:36 am »
You can try to use the wx python scripts for gdb, but you should comment the wx functions from the gdb_types.script file in the codeblocks distribution.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MyMindsAvatar

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Debugger settings for wxWidgets?
« Reply #2 on: October 31, 2010, 10:45:49 pm »
Thanks oBFusCATed. I tried editing the dgb_types.script file but it didn't appear to have the any effect. I don't know how to try the wx python scripts suggestion in favour of what I'm currently using, so anything more on that would great.

I was wondering if this is because 2.9.1 is a developmental release and the string handling has been updated with better Unicode support, cf. 2.8.11 (current stable release)? Could this be a part of it, do you think?

Many thanks,

Richard ~

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger settings for wxWidgets?
« Reply #3 on: October 31, 2010, 11:20:54 pm »
Yes, I think they've modified the internals of wxString in 2.9+, so the scripts coming with C::B aren't working...

You should remove the functions that register wxString parsing in C::B.
Then this might help: http://wxwidgets.blogspot.com/2009/01/pretty-printing-wxstuff-in-gdb.html
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MyMindsAvatar

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Debugger settings for wxWidgets?
« Reply #4 on: November 01, 2010, 12:00:51 am »
Thanks again oBFusCATed. I've commented out the wxString section from the gdb_types.script (C::B scripts), and have found the print.py file in my wx folder (as indicated by your pretty-printing link). Only thing is, it looks like it should work (contains all the right "paths") but I'm not convinced it's being loaded...how would I check this?

Richard ~

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger settings for wxWidgets?
« Reply #5 on: November 01, 2010, 12:28:28 pm »
Probably this could help: http://tromey.com/blog/?p=524
Or read in the gdb docs, there should be something in it...
Also you need gdb compiled with --enable-python
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Debugger settings for wxWidgets?
« Reply #6 on: November 01, 2010, 12:45:56 pm »
Probably this could help: http://tromey.com/blog/?p=524
Or read in the gdb docs, there should be something in it...
Also you need gdb compiled with --enable-python
http://code.google.com/p/qp-gcc/wiki/GDB

and there is a python wx script support for gdb in the package.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.