Page 1 of 1
Debugging of "inner" strings
Posted: Tue Nov 04, 2008 1:01 pm
by marfi
Please, is possible to debug (show) also string class members defined as array of chars? For example, is possible to show a class name from wxClassInfo in the debugger? Btw, the GDB integration with the CL is realy great!!! Thanx a lot for that!
Re: Debugging of "inner" strings
Posted: Tue Nov 04, 2008 1:10 pm
by eranif
I saw your other post at the wxForum, and did not had time to reply it.
Here is the answer:
Basically to view the class name, you will need to do this (assuming u r using command line):
Code: Select all
p (wxObject*)myclass->GetClassInfo()->GetClassName()
Now, you can define a predefined command to run this for you from settings -> debugger settings...
Name: wxObjectName
Command: (wxObject*)$(Variable)->GetClassInfo()->GetClassName()
Now, when right clicking on any word in the editor, while debugging, you will get this option: Watch as 'wxClassName'
Selecting it, will add entry in the 'Watch' tab in the 'Debugger' pane.
However: the return value of this command is wxChar... and gdb lacks the option to display it properly
You can take the address and palace it in the 'Memory' tab - this will show you the name
Eran