Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does LLDB have convenience variables ($var)?

Tags:

lldb

Does LLDB have convenience variables? If so, how do I use them? If not, is there anything similar that I can use?

Reference: http://software.intel.com/sites/products/documentation/hpc/atom/application/debugger/commands143.html

like image 495
an0 Avatar asked Jun 25 '12 15:06

an0


People also ask

What is LLDB in Xcode?

LLDB is the system debugger on macOS, iPadOS, iOS, tvOS, and watchOS. It can also be used for Objective-C and Swift development for architectures: x86_64. i386, ARM and AArch64, and default debugger in Xcode on macOS. It supports debugging on desktop, in simulators and devices.

How do you set a breakpoint in LLDB?

In lldb you can set breakpoints by typing either break or b followed by information on where you want the program to pause. After the b command, you can put either: a function name (e.g., b my_subroutine ) a line number (e.g., b 12 )

What is PO in LLDB?

1. The po command is added to the built-in command set in lldb using: "command alias po expr -O --". If you run help po the last line in the output is: "'po' is an abbreviation for 'expression -O --'. The -- indicates the end of the command options, so all your input on the line is your expression.


1 Answers

I finally figured it out myself. Run help expr in LLDB and you will see:

User defined variables: You can define your own variables for convenience or to be used in subsequent expressions. You define them the same way you would define variables in C. If the first character of your user defined variable is a $, then the variable's value will be available in future expressions, otherwise it will just be available in the current expression.

So expr int $foo = 5 is what I want.

like image 106
an0 Avatar answered Nov 11 '22 12:11

an0