debug strange behavior

Hi.
Why my debugger doesn't go sequentially in the code?

Sometimes it goes back (i am not talking about loops). and than continue.

for example:
1
2
iResult = sitalRt_DataBlock_Create(uiDeviceID, DataBlockID, sitalRtDataBlockType_DOUBLE, &DataWordsBuffer[0], 32);
printf("\n\r sitalRt_DataBlock_Create:%i",iResult);


It goes from iResults to printf, and then go back to iResults. it happen in many places.

Thanks in advanced.
Last edited on
Which debugger are you using? Are you using it with debug or release build code? How you got any optimisations enabled?
I am using g++

In the highest optimization level. But seems like the reason for those jumps is
because i uses static variables
Many compiler optimizations affect debugging. Consider using -Og

-Og

Optimize debugging experience. -Og should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience. It is a better choice than -O0 for producing debuggable code because some compiler passes that collect debug information are disabled at -O0.
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-Og
Last edited on
Topic archived. No new replies allowed.