15

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.

enter image description here

How can I make it evaluate my expression instead?

Cœur
  • 37,241
  • 25
  • 195
  • 267
asclepix
  • 7,971
  • 3
  • 31
  • 41

5 Answers5

13

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 enter image description here

shim
  • 9,289
  • 12
  • 69
  • 108
Kamil.S
  • 5,205
  • 2
  • 22
  • 51
8

Thanks. I solved with rebuild carthage framework like imtx.me/archives/2719.html

carthage update --platform iOS --no-use-binaries

James Eunson
  • 215
  • 2
  • 5
Luigi Marino
  • 139
  • 6
1

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

Vins
  • 385
  • 4
  • 9
0

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.

Genki
  • 3,055
  • 2
  • 29
  • 42
0

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

infinity_coding7
  • 434
  • 5
  • 16