7

I'm looking for an equivalent of

__asm__ int 3
for ARM/iOS processors for when I'm debugging on a physical device. Is it BKPT? All I want to do is halt the processor so that I can then step past or continue execution at that point like I can with an int 3.
John Saunders
  • 160,644
  • 26
  • 247
  • 397
rforte
  • 1,167
  • 1
  • 11
  • 21

2 Answers2

9

According to an answer for the question Breaking into the debugger on iPhone the equivalent is asm("trap"). But see the other answers for different techniques.

Especially look into conditional breakpoints which is a less invasive method.

Community
  • 1
  • 1
DarkDust
  • 90,870
  • 19
  • 190
  • 224
6

When dealing with macOS ARM:

  1. Clang's __builtin_debugtrap(); function should generate necessary break instruction.
  2. If that won't work, try asm("brk #0x1");
antonone
  • 2,045
  • 1
  • 25
  • 35