AR# 22796


11.1 EDK - Does EDK with GDB support inline (software) breakpoints for MicroBlaze?


How do I insert a breakpoint in the code without inserting a breakpoint in GDB for MicroBlaze?


Inline software breakpoints are not supported. However, you can work around this issue by following these steps to achieve a similar functionality:

1. Write a simple function called int3() as follows:

void int3() {

static int dummy; // to keep gcc from optimizing away code



2. In the main software program, call the int3() wherever the debugger (XMD/GDB) needs to stop:

int main() {


int3(); // software breakpoint



3. From XMD, set a single breakpoint at the int3() function using the "bps int3" command, or do this from GDB using the "break int3" command:

a. In GDB, select File -> Target Settings.

b. Select "Set Breakpoint at int3".

c. Select OK.

Whenever the program calls int3(), it will stop the debugger.

For more information on the difference between hardware and software breakpoints, refer to (Xilinx Answer 21330).

AR# 22796
Date 12/15/2012
Status Active
Type General Article
People Also Viewed