LLDB prints wrong UUID value

LLDB prints the wrong UUID value when unwrapping it as an associated value within a switch‑case statement.

let's consider following example:

enum MyEnum {
    case firstCase(UUID)
}

let myEnum = MyEnum.firstCase(UUID(uuidString: "00000000-0000-0000-0000-000000000000")!)

switch myEnum {
case .firstCase(let uuid):
    print(uuid)
}

When I step into the print statement and type po/p/v in LLDB, it prints out C0F1DF6F-0100-0000-E0F4-DF6F01000000, even though a null UUID was provided. However, when I compile using the release build configuration, the problem disappears.

1 Like

Hi Alexander, is this standalone example enough to reproduce the bug? I could not reproduce it with the latest main lldb.

Hi, this bug is reproducible in the App Store version of Xcode with newly created command line application.

Indeed, this bug is fixed in the latest beta.

1 Like