In gdb, I can use the print command to display a floating point or double variable, and I get a value with several decimal places. The equivalent command in LLDB, expr, seems to round/truncate the value and only show the whole number portion. The format string documentation for LLDB is more than a little obtuse. How do I display a double precision or single precision floating point local variable, including the decimal portion?
if foo = 3.1415926, then
expr foo
displays
foo = 3
Not very helpful.
You can do this with the expr command. It’s cumbersome, but it works: