DragonFly users List (threaded) for 2008-02
how to attach to gdb forked child?
I am trying to figure out where an abort core dump in imake is coming
from, so I do:
(gdb) break main
Breakpoint 1 at 0x8048eb7: file imake.c, line 405.
Breakpoint 1, main (argc=1, argv=0x0) at imake.c:405
. . n several times ...
458 cppit(cleanedImakefile, Template, ImakefileC, tmpfd,
So now I have a new process id.
I run gdb in a new terminal and get:
(gdb) attach 7858
Attaching to program:
ptrace: Device busy.
The program is not being run.
Now gdb bt of the core dump is:
#0 0x280c2978 in kill () from /usr/lib/libc.so.6
#1 0x28117adc in abort () from /usr/lib/libc.so.6
#2 0x0804a0bd in get_stackprotector (inFile=0x281389f4) at imake.c:1061
#3 0x0804a5fc in define_os_defaults (inFile=0x281389f4) at imake.c:1711
#4 0x0804a68b in cppit (imakefile=0x804b40a "Imakefile",
template=0x804b250 "Imake.tmpl", masterc=0x804b25b "Imakefile.c",
outfd=0x28138880, outfname=0x804b247 "Makefile") at imake.c:1726
#5 0x08049122 in main (argc=1, argv=0xbfbff97c) at imake.c:458
But I thought I'd fine more details by stepping through it.
Looking at source I see for its get_stackprotector:
1060 if (pclose(fp))
imake assumes the cc -v output is several lines.
So I see where the problem is probably at -- but can someone teach me how
to find it with gdb itself?
Jeremy C. Reed