Activity log for bug #1881764

Date Who What changed Old value New value Message
2020-06-02 14:01:06 Pascal Enz bug added bug
2020-06-02 14:04:47 Pascal Enz description Changing a globally defined volatile variable by debugger, the programm doesn't noticed it. If I change testVolatileVar by debugger (JTAG on .BSS Memory) in the following example, "nop" Statement is not reached. If the variable is defined in Local Scope, and the Memory were changed by debugger, it works like intended. Not working: volatile uint8_t testVolatileVar = 0; int main(void) { for(;;) { if (testVolatileVar == 1) { asm("nop"); } } } Working: int main(void) { volatile uint8_t testVolatileVar = 0; for(;;) { if (testVolatileVar == 1) { asm("nop"); } } } - release version : arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620 - whether the toolchain was rebuilt or you are using or binary package : Not rebuild - host machine : Ubuntu 18.04 x64 - preprocessed testcase for us to reproduce : as it stated below - symptom(s) : Breakpoint not reached if changed value by debugger (only global defined) Changing a globally defined volatile variable by debugger, the programm doesn't noticed it. If I change testVolatileVar by debugger (JTAG on .BSS Memory) in the following example, "nop" Statement is not reached. If the variable is defined in Local Scope, and the Memory were changed by debugger, it works like intended. Not working: volatile uint8_t testVolatileVar = 0; int main(void) {     for(;;)     {         if (testVolatileVar == 1)         {             asm("nop");         }     } } Working: int main(void) {     volatile uint8_t testVolatileVar = 0;     for(;;)     {         if (testVolatileVar == 1)         {             asm("nop");         }     } }