Page MenuHomeFreeBSD

Ensure td_dbg_sc_* are correct for new processes/threads.
ClosedPublic

Authored by jhb on Oct 5 2015, 10:39 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 3 2024, 8:17 AM
Unknown Object (File)
Jan 22 2024, 6:08 PM
Unknown Object (File)
Jan 18 2024, 1:17 PM
Unknown Object (File)
Jan 7 2024, 5:54 PM
Unknown Object (File)
Jan 5 2024, 2:49 PM
Unknown Object (File)
Jan 5 2024, 2:49 PM
Unknown Object (File)
Jan 5 2024, 2:49 PM
Unknown Object (File)
Jan 5 2024, 7:59 AM
Subscribers

Details

Summary

Fix various edge cases related to system call tracing.

  • Always set td_dbg_sc_* when P_TRACED is set on system call entry even if the debugger is not tracing system call entries. This ensures the fields are valid when reporting other stops that occur at system call boundaries such as for PT_FOLLOW_FORKS or when only tracing system call exits.
  • Set TDB_SCX when reporting the stop for a new child process in fork_return(). This causes the event to be reported as a system call exit.
  • Report a system call exit event in fork_return() for new threads in a traced process.
  • Copy td_dbg_sc_* to new threads instead of zeroing. This ensures that td_dbg_sc_code in particular will report the system call that created the new thread or process when it reports a system call exit event in fork_return().
  • Add new ptrace tests to verify that new child processes and threads report system call exit events with a valid pl_syscall_code via PT_LWPINFO.

I knew that td_dbg_sc_* were not copied properly and wanted to fix that
before MFC'ing. While writing the tests to verify that I came across
the other issues which are fixed here.

Test Plan
  • Run the new tests.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb retitled this revision from to Ensure td_dbg_sc_* are correct for new processes/threads..
jhb updated this object.
jhb edited the test plan for this revision. (Show Details)
jhb added a reviewer: kib.
kib edited edge metadata.
This revision is now accepted and ready to land.Oct 6 2015, 6:21 AM
This revision was automatically updated to reflect the committed changes.