Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12648 Discussions

Setting a conditional breakpoint

Altera_Forum
Honored Contributor II
1,524 Views

Is there any way to set a conditional breakpoint in the NIOS IDE tool. 

I would like to set a breakpoint during a condition within an if statement. 

For example 

 

for(i = 0; i < 0x1ffffff; i++) 

 

Set a break point at 0x1000000 

 

There is an option in the properties menu of the breakpoint (image attached) to set a condition but it does not appear to break if I enter a value in the field. 

 

Is this type of breakpoint possible? 

 

Thanks 

 

 

file:///C:/DOCUME%7E1/EBrown/LOCALS%7E1/Temp/moz-screenshot.png
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
650 Views

I have never tried setting a true conditional break point in Nios II IDE. However, a technique I have used before with many architectures is to simply add a NOP to your code with an IF statement on your condition. Then you can set a regular break point on the NOP. 

 

So for your example, you could do something like:for(i = 0; i < 0x1ffffff; i++) { . . . if(i == 0x1000000) __asm__ volatile("nop"); <-- set break point here . . . }
0 Kudos
Altera_Forum
Honored Contributor II
650 Views

The only way such a breakpoint could be done would be for the debugger to break on every iteration and then perform the the required data test - continuing execution is the test wasn't met. I think gdb can do this, but you probably need to find the gdb command prompt! 

So putting a breakpoint on a 'nop' is probably easier.
0 Kudos
Reply