Can't display some variables in LLDB: unresolved identifier

The local variables are right there in the function in my current stack frame, but I can't look at them.


(lldb) po newPath

error: <EXPR>:3:1: error: use of unresolved identifier 'newPath'


Some variables print as expected, some dont.


SWIFT_OPTIMIZATION_LEVEL is -Onone. Xcode 10, build 10A254a.

Such problems can happen from time to time. Unless you’ve done something very wacky with your project settings the root cause is almost always a bug (specifically, a poor interaction between the compiler, the debugger, and the debugged process). If you can isolate the problem to a small test project, it’s definitely worth filing a bug report with that project.

In the meantime, you have some options. You can use

p
rather than
po
and, if that fails,
frame variable
. WWDC 2018 Session 412 Advanced Debugging with Xcode and LLDB has a really good explanation of how these are different, and lots of other general background on this issue

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Can't display some variables in LLDB: unresolved identifier
 
 
Q