In my homegrown assert macro, I've been using asm("trap") on iOS devices (or asm("int3") on iOS simulators) to break in the debugger. However, in 64-bit builds for devices, I get an "unrecognized instruction mnemonic" for the trap instruction. Is there an equivalent for arm64?
(Alternatives like __builtin_trap() or raise(SIGINT) do work, but have some behavior I don't like; the former won't let you continue past the break, and the latter is a function so you're always one step below where you need to be in the stack when you break.)
I was able to break into the debugger (and continue afterwards) with asm("svc 0");
. I’m not sure this is the correct way but it seems to do the job.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With