When I compile the following file with gcc 3.2.2 on RH
Linux:
gcc -ggdb -O0 -o bug_test bug_test.c
and open in kdbg 1.2.9
I can not seem to see the contents of test:
when I have the pointer above it, I get the answer: ???
while for test2 I get {...}.
In addition, I can watch test2, but not test.
in gdb I can print test
-------bug_test.c---------------------
#include <stdio.h>
#define GRAND_N 624
typedef struct {
unsigned long state[GRAND_N]; /*!< the array for the
state vector */
int left; /*!< can *next++ this
many times before
reloading
*/
unsigned long *next; /*!< next random value
is computed from here */
} genRandT;
int main() {
genRandT test;
genRandT test2;
int i;
FILE *fp;
for (i=0; i<GRAND_N; i++) {
test.state[i] = i;
}
test.left = 1;
test.next = &(test.state[50]);
fp = fopen("bugtest.out","w");
for (i=0;i<GRAND_N;i++) {
fprintf(fp, "%d ", test.state[i]);
}
fclose(fp);
return 0;
}
----------------------------------------------------
Logged In: YES
user_id=20017
The reason is that large arrays with many different values are
terminated by '...', which KDbg did not recognize.
Thanks for the report,
-- Hannes