avravr-gccatmelstudio

Debug in Atmel Studio jumps to wild area of code when 'step out' is pressed


Good day all!

I am running the latest Atmel Studio 7 with all patches. AVR-GCC is being used with a 32U4 avr plus an Atmel-ICE via JTAG.

I am in an ISR function and step over works fine each time I press until I call a separate function. When I get to this function I am on the 1st line of code. The next press of step over does not go to the next line as it clearly should but jumps back to the middle of my ISR function in a random place.

The code is not working over all but did before the last few changes.

How do I go about troubleshooting this?

Thanks!


Solution

  • Turns out I had set the optimization to -o3 and then -os

    when I set back to default -o1 ... all was well.

    I guess the AVR-gcc can't handle it?