Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/21/07 22:01
Read: times


 
#141145 - Yep, very likely the optimization
Responding to: ???'s previous message
When the compiler optimizes the code (especially for size), it will reuse pieces of machine code it has already generated, modify register values without storing them back to RAM until absolutely necessary as well as all sorts of other tricks.

So, the structure of the code that the uC ends up executing can actually bares little resemblance to the structure of your C code. It should hardly be surprising then, that the debugger is jumping all over the place.

Always turn optimization off when debugging. If your program only fits in the platform's available memory when optimize-for-space is enabled, then things get a bit messy. Either use more memory on your prototype for debugging, or if possible, debug your firmware a few pieces at a time.

Matt.


List of 15 messages in thread
TopicAuthorDate
stepping throught "c" code            01/01/70 00:00      
   Optimizations.            01/01/70 00:00      
   Optimization Level ?            01/01/70 00:00      
      Yep, very likely the optimization            01/01/70 00:00      
         Fly what you debug; Debug what you fly            01/01/70 00:00      
            Fly what you TEST; TEST what you fly            01/01/70 00:00      
               It's about time            01/01/70 00:00      
                  OH?            01/01/70 00:00      
                     Re: OH?            01/01/70 00:00      
                        If you have a very complicated calculation            01/01/70 00:00      
                           break it up            01/01/70 00:00      
                              I give up            01/01/70 00:00      
                                 Nevermind            01/01/70 00:00      
      Debugging problems            01/01/70 00:00      
         Update            01/01/70 00:00      

Back to Subject List