Search code examples
iosobjective-cxcodebreakpointslldb

Error in breakpoint condition


I've set a breakpoint with the condition...

[event.name isEqualToString:@"Some Name"]

This works fine.

However, when I try to add another breakpoint with the condition...

[part.name isEqualToString:@"Some Value With A Pound Sign £"]

I get the error...

Internal error [IRForTarget]: An Objective-C constant string's string initializer is not an array
Stopped due to an error evaluating condition of breakpoint

Do I need to escape the pound sign or something?


Solution

  • There's a bug with the expression parser and an NSString literal containing non-ASCII characters.

    (lldb) po @"u"
    $9 = 0x00007fff7debe5e0 u
    (lldb) po @"ü"
    Internal error [IRForTarget]: An Objective-C constant string's string initializer is not an array
    error: warning: expression result unused
    error: The expression could not be prepared to run in the target
    

    There is already a bug reported filed with http://bugreport.apple.com/ about this issue.

    Non-ASCII C string literals are handled correctly so it is possible to work around this, e.g.

    (lldb) po [NSString stringWithUTF8String:"ü"]
    $11 = 0x000000010010b040 ü