3 weeks, 5 days ago.
Is it a bug of Mbed Studio when debuging?
Hi, there is a strange thing when debuging using mbed studio (0.6.1). As the .gif illustrated, the code "printf("debug test.\n");" is executed before the code "++count;" when debuging. Why does this happen?
3 weeks, 4 days ago.
This strange "phenomenon" (statements are not executed in the same sequence as specified in the C++/C source code) is usually caused by optimization performed by the compiler when building the binary code. It isn't specific only for the Mbed Studio. One can observe it also when building/debugging with the GCC Arm compiler. To avoid it turn off any optimization when building a project for debugging.