iDevGames Forums
Xcode4: Debugger - how do you view class members? - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Tools & Technology (/forum-10.html)
+--- Thread: Xcode4: Debugger - how do you view class members? (/thread-8832.html)



Xcode4: Debugger - how do you view class members? - SparkyNZ - Apr 13, 2011 11:50 AM

Hi, I have a breakpoint. I can see the contents of local variables when I hover the cursor over the variable names, but for some reason I cannot do the same with class member variables.

Is this just not possible within Xcode or do you have to enable something?

I don't really want to resort to logging values with NSLog etc.

I'm using C++, whether that makes any difference or not?


RE: Xcode4: Debugger - how do you view class members? - OneSadCookie - Apr 13, 2011 11:56 AM

you can type "p whatever" into the GDB console if all else fails.


RE: Xcode4: Debugger - how do you view class members? - SparkyNZ - Apr 13, 2011 03:04 PM

Cool! Thanks once again Cookie! :-)


RE: Xcode4: Debugger - how do you view class members? - SparkyNZ - Apr 13, 2011 04:41 PM

(Apr 13, 2011 11:56 AM)OneSadCookie Wrote:  you can type "p whatever" into the GDB console if all else fails.

I've just had a case where this doesn't work:
Code:
(gdb) p m_CursorRow
current stack frame does not contain a variable named `self'

Whats going on here? Shock

Oh.. I just found it - I have to manually change the stack content.. Hmm.. I guess I'm so used to MS Visual Studio doing everything for me. Smile


RE: Xcode4: Debugger - how do you view class members? - bdsowers - Jul 4, 2011 03:08 PM

You can also inspect 'self' inside the "Local" debug window and dig down, where you can inspect the value of member variables. It can be a bit of a pain with classes that have lots of parent classes though.