How do I quickly inspect the value of an arbitrary variable in Xcode 4.6.x?
Asked Answered
B

3

9

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?

Benita answered 13/4, 2013 at 13:43 Comment(7)
By marking breakpoint, and moving the mouse pointer to that variableOrrin
@AnoopVaidya no dice - see hereBenita
How that popup window came? right clicked?Orrin
no just hovering over the variable and clicking on the arrow. Are you using 4.6?Benita
yes...... It should work. Check with some other XCode on diffrnt systems. get conformed and then re-install XCode.Orrin
Thanks, reinstalling Xcode is a bit drastic and like I said I'd just like to be able to run the po command anyways. A lot of other people are having the same problem so I'm hoping a fix is on the way.Benita
A lot of people!!!!! Let me check again with XCode4.6.1. I have XCode4.6.0 there it is perfect.Orrin
B
0

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

Benita answered 26/4, 2013 at 14:50 Comment(0)
J
4

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 :

enter image description here

Jenette answered 13/4, 2013 at 14:45 Comment(4)
Have 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.Benita
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.Jenette
what if it is a dictionary? or an ivar which you want to inspect?Benita
I have a little dictionary with 3 key/value pairs, still not any lag or delay.Jenette
B
1

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.
Bruise answered 13/4, 2013 at 15:29 Comment(1)
the problem with Xcode 4.6 is that for many users the p/po commands are very slow #14760706Benita
B
0

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

Benita answered 26/4, 2013 at 14:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.