Re: gdb ignores set follow-fork-mode child

Peter Skvarka <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
I tried to avoid set follow-fork-mode child, but there is some different 
problem:

I am able to step through started program and step through forked parent 
in gdb.

I tried
to add nanosleep() for 20 seconds to forked child
setting breakpoint on next line after nanosleep()
and then to attach with gdb.

After attaching it stops inside of nanosleep(), when continuing it crashes.

I don't understand what happens here. Any ideas ?
This problem with attaching to process with running nanosleep() happens 
also in forked parent.

...
Reading symbols from /usr/X11R7/lib/libXrender.so.2...
(No debugging symbols found in /usr/X11R7/lib/libXrender.so.2)
Reading symbols from /usr/libexec/ld.elf_so...
Reading symbols from /usr/libdata/debug//usr/libexec/ld.elf_so.debug...
[Switching to LWP 2315 of process 2315]
0x000070af574474da in _sys___nanosleep50 () from /usr/lib/libc.so.12
(gdb) bt
#0  0x000070af574474da in _sys___nanosleep50 () from /usr/lib/libc.so.12
#1  0x000070af596083b7 in __nanosleep50 (rqtp=<optimized out>, 
rmtp=<optimized out>) at /usr/src/lib/libpthread/pthread_cancelstub.c:445
...
...
(gdb) c
Continuing.
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x436a24
Cannot insert breakpoint -7.
Temporarily disabling shared library breakpoints:
breakpoint #-7

Command aborted.
(gdb)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.