Hello,
My problem is about debugging within "C::B", "watches" and viewing the contents of fixed size arrays passed to functions.
Below is a simplified example code.
#define N_ARRAY_S_LENGTH 100
int main()
{
fun_1();
return 0;
}
void fun_1()
{
unsigned char array[N_ARRAY_S_LENGTH];
[...]
fun_2(array);
[...]
}
void fun_2(unsigned char array[N_ARRAY_S_LENGTH])
{
[...]
fun_3(array);
[...]
}
void fun_3(unsigned char array[N_ARRAY_S_LENGTH])
{
array[0] = 'a';
array[1] = 0x0;
array[2] = 'b';
}
If I watch "array" in the "Watches" view when the debugging cursor points:
- inside "fun_3()" - I get: a
- inside "fun_2()" - I get: a
- inside "fun_1()" - I get: a\000b (this is what I would expect in the two previous cases).
The problem is that I can't check the contents of "array" when I'm inside "fun_3()" or "fun_2()", I have to wait till I'm back into "fun_1()".
So I am wondering why is it behaving that way.
Can you help?
Thank you.
--
OS: Debian GNU/Linux 6.0.3 (squeeze)
C::B SVN 7790
Compiler: GNU GCC Compiler
Debugger: GNU GDB