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++

SW breakpoints

Altera_Forum
Honored Contributor II
900 Views

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
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
244 Views

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.
0 Kudos
Reply