LLDB Output less Helpful in Xcode 12.5

I keep running into this error when using po

expression produced error: error: Couldn't realize type of self. Try evaluating the expression with -d run-target

It typically seems to happen during breakpoints in tests.

My Build Configuration is Debug as well.

Any ideas?
expr seems to work

hmm... that might help in some scenarios, but po is my real bread and butter for debugging.

Is there seriously no one else experiencing this?

po is my real bread and butter for debugging.

po is a hard habit to break, I’ll admit, but it’s not always the right choice. We gave a great talk about this at WWDC a few years back, namely WWDC 2019 Session 429 LLDB Beyond “po”. The problem with po is that it has to run code in the inferior, and that’s a tricky task that can trigger all sorts of failures

Having said that, if you have a reproducible problem with the debugger, it’d be great if you could file a bug about it. It’s important to attach a project that reproduces the issue. If you can’t share your main project, try isolating the key components into a small test project. That’s not such a bad thing to do anyway; it can help you understand what’s triggering the problem and thus suggest a workaround.

Please post your bug number, just for the record.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
I'll have to give that a watch when I have a moment, and I'll try to find time to isolate it for a bug report, but I'm not optimistic about that happening. Life at a startup, you know? That backlog ain't going to shorten itself.

Is it worth filing a bug report without a sample project? I could at least provide some context and hopefully get it noticed.
I have this problem a lot when working with swift packages inside of a workspace. Mainly if I set a break point in the package, sometimes the break points won't work either. Using "expression/expr" works most of the time in this case though.

Is it worth filing a bug report without a sample project?

I talked with the LLDB team about this and the answer was an emphatic “Yes!” So please file the bug with whatever info you have available.



One thing you can do to help out here is enable LLDB’s logging and attach a log file to your bug report. First add this to your .lldbinit file:

Code Block
% cat ~/.lldbinit
log enable -f /tmp/lldb.log lldb types expr


I’m using /tmp/lldb.log but use whatever path works for you.

If you’re using Xcode, make sure that lldb-rpc-server picks up this change. The easiest way to do that is to quit and relaunch Xcode.

Finally, reproduce the problem and, once your done, gather up the log and attach it to your bug.

Thanks in advance!

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

FWIW, right clicking on the variable in the inspector and then choosing "Print Description of " produces the same error. I assume because Xcode itself is still using po.

I assume because Xcode itself is still using po.

Yes. Well, the Print Description does, but that shouldn’t come as a surprise given the command name (-: However, the values that Xcode displays in the main Variables View is driven by the same infrastructure as v.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Please use p to see the values of the variables

Is this the desired behaviour?

Desired by who? Because it sounds like it’s causing you grief and, if so, you should file a bug about that. See my earlier posts for suggestions on how best to file a bug here.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I start getting the same error with Xcode 16.1 Filled the feedback FB15698341

LLDB Output less Helpful in Xcode 12.5
 
 
Q