Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Setting a conditional breakpoint

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

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
        .
        .
        .
    }
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.