Xcode4: Debugger - how do you view class members?

Member
Posts: 48
Joined: 2011.03
Post: #1
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?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
you can type "p whatever" into the GDB console if all else fails.
Quote this message in a reply
Member
Posts: 48
Joined: 2011.03
Post: #3
Cool! Thanks once again Cookie! :-)
Quote this message in a reply
Member
Posts: 48
Joined: 2011.03
Post: #4
(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
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2011.07
Post: #5
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.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Xcode4: Resource not in Documents folder? SparkyNZ 3 6,530 Apr 9, 2011 03:29 PM
Last Post: SparkyNZ
  XCode combining debugger and console?? Toontingy 2 5,331 Feb 16, 2010 07:55 PM
Last Post: Toontingy
  iPhone application always opens with the debugger! frogameleon 0 2,512 Mar 6, 2009 10:02 AM
Last Post: frogameleon
  using the xcode debugger NSDuo 8 5,642 Jan 14, 2009 04:52 PM
Last Post: NSDuo
  Xcode debugger and C++ global/file scope variables. WhatMeWorry 2 4,968 Sep 9, 2005 12:34 AM
Last Post: WhatMeWorry