1. Apa arti serta guna file "core" ini ?
2. Bagaimana cara menggetahui kesalahan (bug) dari tool/software ? debugger-kah?
1. core adalah memory dump dari program
2. Betul. Debugger. Lihat sedikit contoh dibawah dengan gdb.
Jika tidak ada core yang tergenerate, ulimit -c <n> dulu (where n is any big number -> man ulimit)
Untuk compilation flags harus pake -g (man gcc)
--- BEGIN EXAMPLE ---
$ export CFLAGS="-Wall -g" # menggunakan bash
$ cat << EOF > testcore.c
int main()
{
char s[255];
s[10000000] = 'x';
}
EOF$ make testcore cc -Wall -g testcore.c -o testcore testcore.c: In function `main': testcore.c:5: warning: control reaches end of non-void function
$ ./testcore Segmentation fault (core dumped)
$ gdb testcore core
GNU gdb 5.3
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "i586-suse-linux"...
Core was generated by `./testcore'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /lib/libc.so.6...done.
Loaded symbols for /lib/libc.so.6
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0 main () at testcore.c:4
4 s[1000000] = 'x';
-- END EXAMPLE --
Semoga membantu.
Rachman
-- Berhenti langganan: [EMAIL PROTECTED] Arsip dan info: http://linux.or.id/milis
