How do I set a software breakpoint on an ARM processor?

前端 未结 8 957
北恋
北恋 2021-02-12 14:40

How do I do the equivalent of an x86 software interrupt:

asm( \"int $3\" )

on an ARM processor (specifically a Cortex A8) to generate an event

8条回答
  •  时光取名叫无心
    2021-02-12 14:49

    We can use breakpoint inst:

    • For A32: use BRK #imm instruction

    • For Arm and Thumb: use BKPT #imme instruction.

    Or we can use UND pseudo-instruction to generate undefined instruction which will cause exception if processor attempt to execute it.

提交回复
热议问题