Hi, main() { for (i=1; i<=180; i++) {
I'm trying to debug my small C program on RedHat Linux PC at home.
While running my program, I press Ctrl-\, SIGQUIT, to make a core dump image.
Then, use gdb to resume execution of the program as following with some error:
-------------------------------attachment----------------------------------
$ cat count.c
#include <stdio.h>
int i;
printf("\rCount=%d",i);
fflush(stdout);
sleep(1);
}
$ gcc -o count count.c
$ count
... ... ... ... ...
^\ Pressed
(core dump)
... ... ... ... ...
$ gdb count core
GDB is free software and you are welcome to distribute copies of it
under certain conditions; type "show copying" to see the conditions.
There is absolutely no warranty for GDB; type "show warranty" for details.
GDB 4.15 (i586-unknown-linux), Copyright 1995 Free Software Foundation, Inc...
(no debugging symbols found)...
Couldn't fetch registers from core file: File in wrong format
Couldn't fetch registers from core file: File in wrong format
#0 0x0 in ?? ()
(gdb) cont
The program is not being run.
(gdb) quit
-----------------------------end_of_attachment-----------------------------
There are two errors as shown, one is during loading, the other is issuing
"cont" command.
Does anyone please tell me how to fix these problems?
Regards,
Pisut T.