Global Volatile Variable - Changing by JTAG (MEM) not noticed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
New
|
Undecided
|
Unassigned |
Bug Description
- release version : arm-none-eabi-gcc (15:6.3.
- 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)
{
}
}
}
Working:
int main(void)
{
volatile uint8_t testVolatileVar = 0;
for(;;)
{
if (testVolatileVar == 1)
{
}
}
}