Recently I read that breakpoints on ARM are enforced by either using BKPT instructions or by using instructions that are defined as invalid.

  1. Which method does gdb use?
  2. Do you know of any online assemblers for ARM code?(eg: Id like to assemble the BKPT instruction and see the bytes corresponding to it, but I dont have qemu/SoC chips handy). What do you use?

1 Answer 1


1) This depends on whether your are in THUMB or ARM mode, as these have different opcode sets. This stackoverflow question might be relevant.

2a) I don't know any online assemblers for ARM, but for single instructions, i find this table handy.

2b) If you want to assemble larger chunks of code, probably the easiest method to get a working ARM assembler is installing the Android NDK, which has toolchains for various processors including x86, arm, and mips. As i'm using Ubuntu, my arm assembler is $ndk-root/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/arm-linux-androideabi-as; on windows, i'd assume a .exe file should be in a similar location. My answer to this question shows how to use arm-as and arm-objdump to get the hex bytes quickly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.