It seems reasonably widely acknowledged that it is slow to use the po
command in Xcode 4.6.x. What are the options for inspecting the values of arbitrary variables unspecified at compile time (which rules out usage of NSLog()
) which don't take > 15s?
-
By marking breakpoint, and moving the mouse pointer to that variable– Anoop VaidyaApr 13, 2013 at 13:44
-
@AnoopVaidya no dice - see here– NSTJApr 13, 2013 at 14:00
-
How that popup window came? right clicked?– Anoop VaidyaApr 13, 2013 at 14:13
-
no just hovering over the variable and clicking on the arrow. Are you using 4.6?– NSTJApr 13, 2013 at 14:19
-
yes...... It should work. Check with some other XCode on diffrnt systems. get conformed and then re-install XCode.– Anoop VaidyaApr 13, 2013 at 14:23
3 Answers
Just set a breakpoint where you want to learn the variables' value. Once the program is paused, a summary of all the variables' value will appear on the Varibles view
on the left-bottom of the screen. Here is a screenshot :
-
1Have you tried doing this with Xcode 4.6? There is a lag of up to 30s to right click on one of the variables in that pane, not to mention objects, ivars etc.– NSTJApr 13, 2013 at 14:59
-
Well I'm using 4.6.1 and I have no lag at all when I right-click. And why to right-click? You have the values without clicking.– MorayApr 13, 2013 at 15:04
-
-
I have a little dictionary with 3 key/value pairs, still not any lag or delay.– MorayApr 13, 2013 at 15:34
You can use the lldb commands:
p (int) myInt
po myObject
po myObject.memberObject
p (float) myObject.floatMember
Just a note, you could also use p instead of po in the newest version of Xcode. If you run the help -a
in llb, it will present you with command aliases, below is a snippet of the commands you could use.
> (lldb) help -a
p -- ('expression --') Evaluate a C/ObjC/C++ expression in the current
program context, using user defined variables and variables
currently in scope.
po -- ('expression -o --') Evaluate a C/ObjC/C++ expression in the
current program context, using user defined variables and
variables currently in scope
print -- ('expression --') Evaluate a C/ObjC/C++ expression in the current
program context, using user defined variables and variables
currently in scope.
-
1the problem with Xcode 4.6 is that for many users the
p
/po
commands are very slow stackoverflow.com/questions/14760206/…– NSTJApr 13, 2013 at 15:36
Turns out the answer is pretty simple: download Xcode 4.6.2 where LLDB debugging speed has been increased significantly. Note some discussion over here