UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 22796

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

Description

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

Solution

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

dummy++;

}

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 Created 09/04/2007
Last Updated 12/15/2012
Status Active
Type General Article