tags:

views:

30

answers:

2

Is there any command using which we can inspect a object in command line while app is running in DEBUG mode. I do not want to put description message in the code.

A: 

Try these resources. one two

(gdb) p varName
Stephen Furlani
Thank you, This is what I was looking for.
Abhinav
Here it is printing the memory address of objects like dictionary, array etc. I want to see what is the data they are holding inside. Any clue on this?
Abhinav
Try `(gdb) p (float)[objName varFloat]` I don't think you can use 'dot' syntax. the other option is to do `(gdb) p (float)objName->_privateVar` but I don't think that'll work
Stephen Furlani
A: 

Yes sure. If you are debuging, breakpoints are automatically set to on. Just set a breakpoint to the line in which the variable is. The program stops as soon it reaches the line with the breakpoint. Just hold the cursor over the variable and all important data is displayed. I do it also that way all the time. ;-)

Sandro Meier