A debugger which requested PT_FOLLOW_FORK should get the notification

about new child not only when doing PT_TO_SCX, but also for PT_CONTINUE.
If TDB_FORK flag is set, always issue a stop, the same as is done for
TDB_EXEC.

Reported by:	Dmitry Mikulin <dmitrym juniper net>
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2012-01-30 20:00:29 +00:00
parent 6d7610d75a
commit 6ad1ff09cc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230785

View File

@ -212,7 +212,8 @@ syscallret(struct thread *td, int error, struct syscall_args *sa __unused)
* executes. If debugger requested tracing of syscall
* returns, do it now too.
*/
if (traced && ((td->td_dbgflags & TDB_EXEC) != 0 ||
if (traced &&
((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 ||
(p->p_stops & S_PT_SCX) != 0))
ptracestop(td, SIGTRAP);
td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK);