Reputation: 8061
Using Xcode 10, when I stop my app using a breakpoint and try to print the content of an object in the Console, I obtain:
"Couldn't IRGen expression, no additional error"
However, I can see the value of the object in the Variables View panel.
How can I make it evaluate my expression instead?
Upvotes: 15
Views: 4945
Reputation: 5543
In lldb
as a workaround you can use:
fr v productVersion
fr v productBuild
since Xcode 10.2
v productVersion
v productBuild
which prints local variable type and address from current call stack frame.
Apple documentation for these kind of lldb capabilities: https://developer.apple.com/library/archive/documentation/General/Conceptual/lldb-guide/chapters/C5-Examining-The-Call-Stack.html
UPDATE: Another trick that seems to help is to set
Upvotes: 13
Reputation: 494
My env: Xcode 11.6 and Xcode 12 Beta 6, carthage 0.34.0
In my case, my company wants me to make build of our app out of Xcode 12 beta and see what's broken. I did it and encounter another bug that crippled the carthage. I fixed it by following this answer in the same thread.
Then I switched back to Xcode 11.6, the error started to appear
error: Couldn't IRGen expression, no additional error
The variable inspector works normally but debug console is useless without print or po. It took me some time to search in SO before I realized this might be related to carthage. Then I updated all my dependencies using the following command
carthage bootstrap --platform iOS --no-use-binaries --cache-builds
Then the debug resume normal and I can use print/po again
Upvotes: 0
Reputation: 3195
For my colleague, carthage update --platform iOS --no-use-binaries
was working but it was not for me. When I removed the Carthage
folder and reran the command, the po
command started working 🎉. I'm not sure if it's related but I'm on macOS Catalina 10.15.3 and he is on Mojave. We both have Carthage version 0.34.0.
Upvotes: 0
Reputation: 385
I had defined as build system: "Legacy Build System", I changed it to "New Build System", then I build the project, and then I put it back as "Legacy Build System" and it worked again.
For to change the build mode: File->Workspace settings...->Build System
Upvotes: 1
Reputation: 139
Thanks. I solved with rebuild carthage framework like imtx.me/archives/2719.html
carthage update --platform iOS --no-use-binaries
Upvotes: 8