LLDB: Couldn't IRGen expression

niklassaers picture niklassaers · May 15, 2017 · Viewed 19.2k times · Source

When I'm running a unit test and want to debug something, I set a breakpoint and type for instance "po myVariable". The response I get from LLDB is:

error: Couldn't IRGen expression, no additional error

Example:

I have the smallest little unit test defined here:

class MyExampleTests: XCTestCase {
    func testLLDB() {
        let world = "World"
        print("Breakpoint goes here")
        print("Hello \(world)")
    }
}

I set my breakpoint in "Breakpoint goes here", and when I run, I do 'po world':

(lldb) po world
error: Couldn't IRGen expression, no additional error

Any suggestions to how I can make it evaluate my expression instead?

Answer

Jonathan Cabrera picture Jonathan Cabrera · Oct 23, 2018

I was having the same issue using Carthage frameworks, and got the LLDB debugger working again by deleting the Carthage folder in the project root and forcing Carthage to rebuild the frameworks from source:

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