9.102 __breakpoint intrinsic

This intrinsic inserts a BKPT instruction into the instruction stream generated by the compiler.

It enables you to include a breakpoint instruction in your C or C++ code.


void __breakpoint(int val)
is a compile-time constant integer whose range is:
0 ... 65535
if you are compiling source as ARM code
0 ... 255
if you are compiling source as Thumb code.


The compiler does not recognize the __breakpoint intrinsic when compiling for a target that does not support the BKPT instruction. The compiler generates either a warning or an error in this case, depending on the source language:
  • In C code: Warning: #223-D: function "__breakpoint" declared implicitly.
  • In C++ code: Error: #20: identifier "__breakpoint" is undefined.
The undefined instruction trap is taken if a BKPT instruction is executed on an architecture that does not support it.


void func(void)
Related information
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.