This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug breakpoints/13457] `catch syscall' doesn't work for parent after `fork' is called


https://sourceware.org/bugzilla/show_bug.cgi?id=13457

--- Comment #3 from Pedro Alves <palves at redhat dot com> ---
While following the parent happened to get fixed by that patch, following the
child when we stay attached to the parent is not.  E.g.,

gdb -q ./testsuite/gdb.base/foll-fork -ex "set follow-fork child" -ex "set
detach-on-fork off"
Reading symbols from ./testsuite/gdb.base/foll-fork...done.
(gdb) catch fork
Catchpoint 1 (fork)
(gdb) r
Starting program: testsuite/gdb.base/foll-fork

Catchpoint 1 (forked process 2045), 0x00000033356bc87c in __libc_fork () at
../nptl/sysdeps/unix/sysv/linux/fork.c:130
130       pid = ARCH_FORK ();
(gdb) catch syscall
Catchpoint 2 (any syscall)
(gdb) c
Continuing.
[New process 2045]
[Inferior 2 (process 2045) exited normally]
(gdb) 


vs:


$ gdb -q ./testsuite/gdb.base/foll-fork -ex "set follow-fork child" -ex "set
detach-on-fork on"
...
Catchpoint 1 (forked process 2084), 0x00000033356bc87c in __libc_fork () at
../nptl/sysdeps/unix/sysv/linux/fork.c:130
130       pid = ARCH_FORK ();
(gdb) catch syscall 
Catchpoint 2 (any syscall)
(gdb) c
Continuing.
[New process 2084]

Catchpoint 2 (call to syscall exit_group), 0x00000033356bcaf9 in __GI__exit
(status=status@entry=0) at ../sysdeps/unix/sysv/linux/_exit.c:32
32            INLINE_SYSCALL (exit_group, 1, status);
(gdb) 


I'd be great if a test case exercised all variations of follow-fork parent/
child, detach-on-fork on/off.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]