[Lldb-commits] [PATCH] D16853: Use BKPT instead of UDF for arm/thumb breakpoints

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 3 10:17:59 PST 2016

clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

There are immediate values you can play around with inside the BKPT instruction of both ARM and Thumb versions so that the two least significant bytes are the same:

static const uint8_t g_arm_breakpoint_opcode[] = { 0x70, 0xBE, 0x20, 0xE1 };
static const uint8_t g_thumb_breakpoint_opcode[] = { 0x70, 0xBE };

Note both start with 0xBE70 when using the above definitions. This means if you guess wrong and set an ARM breakpoint in Thumb code, you will still stop and not hose your program over. I would recommend using these values just to be safe.


More information about the lldb-commits mailing list