What call are you supposed to make for iOS breakpoints (f.e. assert).
For debugging I recommend sending the
SIGTRAPsignal to yourself.
You’ll have to then step out of the
killsystem call, but that’s easy.
In production code, use
The difference is important.
__builtin_traphas some key advantages in production:
It traps at the point of failure, meaning you’re more likely to have useful content in registers.
It is marked as ‘not returning’, which is more grist for the optimiser.
OTOH, when debugging it’s actually good to have avoid a ‘not returning’ mechanism because you actually want to step past the failure.
Also how is it that Xcode is still unable to step into C++ 11 lambdas?
You should watch WWDC 2016 Session 417 Debugging Tips and Tricks, which discusses some of the challenges in this space. Beyond that, for debugger specific issues I recommend you post over in Xcode > Debugger.
Share and Enjoy
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"