Debugging of "inner" strings

General questions regarding the usage of CodeLite
marfi
CodeLite Expert
Posts: 159
Joined: Mon Nov 03, 2008 9:17 pm
Contact:

Debugging of "inner" strings

Post 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!
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Debugging of "inner" strings

Post 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
Make sure you have read the HOW TO POST thread
Post Reply