|
Hi, most linux systems the core dump is default behaviour unless your core file is exceeding the maximum size allowed by the shell. Try doing the following before running the program:
ulimit -c
if it returns 0, or a small number of bytes, then type in the following:
ulimit -c unlimited
this will allow the creation of a core file of unlimited size (in the directory from which you ran the program.
Now, in order to use the debugger properly, you might have to recompile your program with any optimization turned off, and debugging turned on. But you could try it right away without recompiling and see if the debugger finds the necessary symbols in your program.
The easiest way is to run the program from scratch, within the debugger. gdb is default on most linux systems. Just run "gdb myprogram" after a few seconds you will arrive at the gdb prompt, and type "run" , wait until the program crashes, and type "where" it will attempt to give you a trace of the code, showing which subroutines you are in, and hopefully line numbers as well.
If this process doesn't work, look at the compiler man page or help options to see how to turn off optimization and turn on debugging, recompile and try again...
Good luck!
|