llvm - "Execution was interrupted, reason: breakpoint" when trying to print something from the Xcode console -
i paused app , tried printing console. (e.g. po foo()). after doing so, got following message:
error: execution interrupted, reason: breakpoint 2.1.
process has been returned state before execution.
however, there no breakpoints in function. why showing me error , not executing function?
this on xcode 4.6.
it turns out breakpoint in question (2.1) exceptions breakpoint. method calling raised exception, caused exceptions breakpoint hit. po stop execution once breakpoint reached (see this answer more info).
if disable exceptions breakpoint , run again, more clear there exception:
error: execution interrupted, reason: signal sigstop. process has been returned state before execution. if leave exceptions breakpoint enabled, message can ambiguous: did reach breakpoint because there breakpoint somewhere along execution path, or exception raised?
an alternative solution (which doesn't require disabling exceptions breakpoint) use expr instead of po (see link above description of following flags).
running expr -u 0 -o -- foo() produces following output:
error: execution interrupted, reason: breakpoint 2.1 -2.1. process has been left @ point interrupted. * thread #1: tid = [...] libobjc.a.dylib`objc_exception_throw, stop reason = breakpoint 2.1 -2.1 frame #0: [...] libobjc.a.dylib`objc_exception_throw the objc_exception_throw string hint exception raised.
Comments
Post a Comment