[patch+rfc] Warn the user on forked-off child processes

Daniel Jacobowitz drow@false.org
Wed Dec 5 20:59:00 GMT 2007

On Wed, Dec 05, 2007 at 08:28:50PM +0100, Jan Kratochvil wrote:
> Hi,
> some programs fork(2)-off a child process for some part of its run.  It was
> seen on the LMbench `bin/bw_mem' program.  User sets a breakpoint which is
> silently missed and nobody notices there were multiple processes being run.
> If you would set
>   set debug lin-lwp 1
> you would see a message
>   Detaching after fork from child process 11741.
> but it is clear nobody runs with `set debug lin-lwp 1' set as default.
> I did put there at least a warning message giving advice there is a fork:
>   [Detaching after fork from child process 20372. (Try `set detach-on-fork off'.)]

This message used to be printed; I disabled it because no one seemed
to find it useful.

cvs annotate linux-nat.c -> changed in large change at 1.36 ->
annotate -r1.35 -> changed in localized change at 1.27 -> cvs log

date: 2005/03/06 16:42:20;  author: drow;  state: Exp;  lines: +14 -6
        * linux-nat.c (child_follow_fork): Call target_terminal_ours before
        printing output.  Use fprintf_unfiltered.  Only print output when

(The fprintf_unfiltered part of that seems to have been accidentally
reverted later on.)

I won't approve or reject this patch; please see if other maintainers
find the message useful.

Daniel Jacobowitz

More information about the Gdb-patches mailing list