Forum Discussion

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

SW breakpoints

I'm trying to debug a problem mentioned in another thread, nios behaving erratically (http://http://forum.niosforum.com/forum/index.php?showtopic=6632)

I create breakpoints by double clicking in the margin and the "bubble" appears. When I start a Debug As Hardware session, the first and only breakpoint that is recognized is main(). I click Resume and the code executes w/o stopping. As a sanity check I put a BP on a printf statement and it is clearly executing w/o stopping. I can single step the code after that first break with no apparent problems. With enough single steps, I can even see the printf statement print one character at a time. However, as soon as I click on Resume, the code blows past any breakpoints I have set.

There is no OS, the application is running single-threaded. The breakpoints appear in the breakpoint window. Not sure if this is related but I've already dealt with having to map the cygdrive to c:/ to get the debugger to even launch.

thanks,

s

1 Reply

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

    I checked and rechecked properties, preferences, etc. Out of desperation, I made my first breakpoint conditional with the condition set to "1=1" and left it enabled. Absolutely meaningless statment although true. When I relaunched the debugger, the program halted on that breakpoint!? Hitting Resume caused the program to halt at the second breakpoint, which was NOT conditional. All breakpoints appeared to work. I was able to watch variable etc. properly. Out of curiousity, I removed the conditional statement 1=1 from the breakpoint and all the breakpoints continued to work properly. For now, I'm in business.

    Go figure? Magic indeed....

    If someone can explain this behavior I would love to hear it.