LLDB - Evaluating expressions

Evaluating a generalized expression in the current frame.

(lldb) expr (int) printf ("Print nine: %d.", 4 + 5)
or using the print alias:
(lldb) print (int) printf ("Print nine: %d.", 4 + 5)

Creating and assigning a value to a convenience variable.

In lldb you evaluate a variable declaration expression as you would write it in C:
(lldb) expr unsigned int $foo = 5

Printing the ObjC "description" of an object.

(lldb) expr -o -- [SomeClass returnAnObject]
or using the po alias:
(lldb) po [SomeClass returnAnObject]

Print the dynamic type of the result of an expression.

(lldb) expr -d 1 -- [SomeClass returnAnObject]
(lldb) expr -d 1 -- someCPPObjectPtrOrReference
or set dynamic type printing to be the default: (lldb) settings set target.prefer-dynamic run-target

Calling a function so you can stop at a breakpoint in the function.

(lldb) expr -i 0 -- function_with_a_breakpoint()

Calling a function that crashes, and stopping when the function crashes.

(lldb) expr -u 0 -- function_which_crashes()