OK folks. I set a Data Breakpoint in Atmel studio (With ICEmk2-JTag Debugger) and it won't get hit although the value at the address is changed. (I checked it with following breakpoints) Why is this?
The whole purpose of Data breakpoints is to detect a change of the value at the address, or am I misunderstanding something?
To be more specific: I have a Pointer A that points to a value. But the pointer A is changed (not the value it points to!) by a bug I'm trying to hunt down. So, I created a pointer B that points to the address where pointer A is stored and set a Data Breakpoint on Pointer B. Here is the initialization:
#define lastCMDRingBufferSIZE 255
volatile uint8_t lastCMDRingbuffer[lastCMDRingBufferSIZE]; //
volatile uint8_t*lastCMDRingstartPtr = lastCMDRingbuffer; // This is PtrA
volatile uint32_t*ptrToPtr = &lastCMDRingstartPtr; // PtrB
Or another way to put it; Is a databreakpoint triggered if:
- the content of the address is written by a array overflow?
- the content of the address is interpreted as part of a larger data structure that is somehow written by a rogue pointer? (expl: a 64 bit pointer is dereferenced and written to, as a result a 32bit integer gets overwritten)
Your suspections and advice are highly appreciated :)