[ RooTeR @ 02.01.2005. 14:16 ] @
Kako mogu da vidim vrednosti registara iz core dump-a.

#./mojprogram
Segmentation fault(core dumped)

i sada ja zelim da vidim vrednosti registara pre nego shto je program pukao.
[ zvrba @ 03.01.2005. 08:12 ] @
gdb mojprogram core

(pod uvjetom da se skora u fajl koji se zove core - neki OS-ovi appendaju .PID (gjde je PID bio broj procesa), neki appendaju ime procesa - konfigurabilno je).

pa onda kazes info regs

a ako kompajliras sa -g flagom, mozes vidjeti i source gdje se skrsio
[ DownBload @ 03.01.2005. 22:26 ] @
[root@laptop PHP# php phpvuln.fzz.11759
Segmentation fault (core dumped)
[root@laptop PHP]# gdb php core.17950
GNU gdb Red Hat Linux (5.1.90CVS-5)
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 "i386-redhat-linux"...(no debugging symbols found)...
Core was generated by `AAAAAAAAAAAAAAAAAAAAAA'.
Program terminated with signal 11, Segmentation fault.
Cannot access memory at address 0x4016d000
#0 0x420824ac in ?? ()
(gdb)
(gdb) i r
eax 0x8240507 136578311
ecx 0xc9a 3226
edx 0x53d3 21459
ebx 0x4213030c 1108542220
esp 0xbfff8d4c 0xbfff8d4c
ebp 0xbfff8d78 0xbfff8d78
esi 0x823d29f 136565407
edi 0xbfffffff -1073741825
eip 0x420824ac 0x420824ac
eflags 0x10203 66051
cs 0x23 35
ss 0x2b 43
ds 0x2b 43
es 0x2b 43
fs 0x2b 43
gs 0x2b 43


...otprilike tako ;-)
[ Vojislav Milunovic @ 04.01.2005. 13:54 ] @
Zar beše ne treba neki shell variable ili nešto da se podesi da bi se pravio core fajl?
[ DownBload @ 04.01.2005. 23:12 ] @
Na nekim sistemima treba postaviti limite ...
ulimit -c unlimited