I was just reading this answer on StackOverflow, "How can you debug a process using gdb without pausing it?"
The Linux kernel provides some support for this via
PTRACE_SEIZE, but gdb doesn't use this yet. There's a bug in bugzilla you can track, "Bug 15250 - use
I was able to find
PTRACE_SEIZE documented in
PTRACE_SEIZE(since Linux 3.4): Attach to the process specified in pid, making it a tracee of the calling process. Unlike
PTRACE_SEIZEdoes not stop the process. Group- stops are reported as
WSTOPSIG(status)returns the stop signal. Automatically attached children stop with
SIGTRAPinstead of having
SIGSTOPsignal delivered to them.
execve(2)does not deliver an extra
SIGTRAP. Only a
PTRACE_SEIZEd process can accept
PTRACE_LISTENcommands. The "seized" behavior just described is inherited by children that are automatically at‐ tached using
PTRACE_O_TRACECLONE. addr must be zero. data contains a bit mask of ptrace options to activate immediately. Permission to perform a
PTRACE_SEIZEis governed by a ptrace access mode
PTRACE_MODE_ATTACH_REALCREDScheck; see below.
That raises the question if
PTRACE_SEIZE isn't supported by gdb, what tooling (if any) does support this functionality on Linux?