2

In XCode, when paused at a breakpoint, it's easy to go over to the debug navigator, pick any frame in the stack, and see the variables and their values in that frame.

I'm trying to access the variables in a previous frame in LLDB in this same way. There is an 'up' command that takes you to a previous frame (and other commands to navigate to other frames), but apparently none of the variables in other frames are available to LLDB.

Am I doing something wrong or is this just not possible in LLDB.

1 Answer 1

7

Xcode is using lldb under the covers -- pretty much anything you can do in Xcode, you can do from the command line interface.

You can use the bt command to see a list of frames. up and down work as you noticed; you can also do f 3 to select frame 3. Once you're on a stack frame and want to see the variables, you can use frame variable (or fr v for short) to see the list of variables in scope. If you want to see a single variable, p varname will do it. If it's an Objective-C object, you can do po objname (for "print object") if the object has a description method defined.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.