Core file and detect segmentation fault:
1. config system to support core dump file
%ulimit -c
if output is 0, that means the system is not support core dump, this is the default attribute.
%ulimit -c unlimited, this can increase the size of core dump file
2. compile the programme with -g option
3. run the programme, if it get segmentation fault error, the core dump file is put in the current directory, "core.pid"
4. gcc "programme name" "core.pid"
see the reference url: http://www.network-theory.co.uk/articles/gccdebug.html
1. config system to support core dump file
%ulimit -c
if output is 0, that means the system is not support core dump, this is the default attribute.
%ulimit -c unlimited, this can increase the size of core dump file
2. compile the programme with -g option
3. run the programme, if it get segmentation fault error, the core dump file is put in the current directory, "core.pid"
4. gcc "programme name" "core.pid"
see the reference url: http://www.network-theory.co.uk/articles/gccdebug.html
0 Comments:
Post a Comment
<< Home