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
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.
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 )
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With