Hello to everybody, me and my colleague are debugging a c-code written for a Renesas R8C11 microcontroller (8 bit architecture) and we found some bugs. The most dangerous of these bugs was that in a particular point of the code, because of a "for" cycle badly written, there was an assignment to an array location out of the array bounds causing overwriting of the variable with ram-address following array[9];
Example:
Code:
unsigned char i,k;
...
unsigned char array[10];
...
for(i=0,i<11;i++){ //ERROR @ iteration i =10;
array[i] = k;
}
The question is: how can i know which is the variable that is overwritten whithout going in debug mode (we have space problems so we can't debug)? Is there a way without modifing the code or the compiling/linking options of the project?
I'm sorry for this stupid question but i'm not very familiar to HEW and renesas...