Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 1996 18:59:07 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        alk@Think.COM, jkh@time.cdrom.com
Cc:        hackers@FreeBSD.org
Subject:   Re: longstanding, woeful inadeqacy
Message-ID:  <199606270859.SAA02759@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>: Fork is an easier case since you don't need to swap the debugger's
>: executable out - just attach to the new process.

Erm.  It might be easier because the pc is predictable and breakpoints
in the program test don't go away.  The debugger doesn't move.  However,
the kernel has better support for exec than for fork: the execed program
"stops before executing the first instruction of the new image" (see
ptrace(2)).  This seems to work as well as can be expected.  You have
to load the symbols for the new image.

>Easier in what sense?  It is essentially impossible to debug anything
>that forks, since by the time you can attach to it, it has gone
>veering wildly out of control.

The child process should probably stop too.  It may be too late to fix
this.  Linux is said to have some syscall for stopping processes before
(and after?) all syscalls.  This could be used to keep control if it
works right across fork/exec.  strace probably needs it to work right
across fork/exec to keep control.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606270859.SAA02759>