Break point on debugging process hit same point even if I change position of break point

Hi,

I am debugging NUCLEO-L476RG boad with Mbed Studio.
Break point is not working as intended.

First, I set break point into main() in main.cpp.
And start debugging.
When debugging process hit the break point, the debugging process pause at line89 in mbed_rtx_handlers.c.
Even if I change position of the break point, the process pause at same line in same file.
If I set break point before main(), the process pause at line that I intended.

Could you give me advice how can I hit the break point as intended?

Here are some information of my environment.
mbed OS ver 6.9
target board : NUCLEO-L476RG
Deploy and debug target : stm32l475xg

If you need more information, please let me know.

Hi @syanase ,

We probably should add it to the documentation as it is a common question: Known issues and troubleshooting - Known issues and troubleshooting | Mbed Studio Documentation
I believe that it is because the Arm Compiler 6 optimises the code. That’s why you can’t stop on every line. To disable optimisation please modify your profile. Navigate into: {your_project}/mbed-os/tools/profiles/debug.json and find an entry for ARMC6.common. Replacing a -O1 with -O0 will disable the optimisation.

Thanks,
Arek - Studio team