https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=250954

--- Comment #13 from Konstantin Belousov <[email protected]> ---
(In reply to Michał Górny from comment #12)
I believe the intended use of PT_SETDBREGS in combination with the new thread
tracking is to set debug registers to desired configuration on each
PL_FLAG_BORN
event.  This should be most straight-forward.

WRT to the race itself, trying to close it would affect normal operation of
thread creation, as opposed to just causing minor inconvenience to the
ptrace(2)
consumers.  We create thread, including the setup of all machine state, then
we fire it running, up to the point of running at trampoline returning to the
user space.  This moment is when we report TBD_BORN to ptracestop().  It is
important to do that stop from the context of the running new thread, so that
we already know that all hardware state is copied as needed.  Would we report
TDB_BORN before copying, it means that copying should occur under process lock
to guarantee consistency with potential modifications from debuggers, and we
do not want this.

Also I think existing consumers of TDB_BORN already expect that the event comes
from the running thread, not from the embryo.  So it really need be yet another
event to not break API.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to