]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdbserver/linux-low.cc
gdb/linux: remove ptrace support check for exec, fork, vfork, vforkdone, clone, sysgood
authorSimon Marchi <simon.marchi@polymtl.ca>
Sun, 16 Jan 2022 04:25:59 +0000 (23:25 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 11 Feb 2022 01:10:12 +0000 (20:10 -0500)
commita288518611dbda5cfae8894d532cf1040cb1b6c2
tree8a08bcc229f42cc2f6e64f2045d5225dcaabb06b
parenta9dce16586c147c024b49604aa0603d772372f31
gdb/linux: remove ptrace support check for exec, fork, vfork, vforkdone, clone, sysgood

I think it's safe to remove checking support for these ptrace features,
they have all been added in what is now ancient times (around the
beginning of Linux 2.6).  This allows removing a bit of complexity in
linux-nat.c and nat/linux-ptrace.c.

It also allows saving one extra fork every time we start debugging on
Linux: linux_check_ptrace_features forks a child process to test if some
ptrace features are supported.  That child process forks a grand-child,
to test whether ptrace reports an event for the fork by the child.  This
is no longer needed, if we assume the kernel supports reporting forks.

PTRACE_O_TRACEVFORKDONE was introduced in Linux in this change, in 2003:

  https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=45c1a159b85b3b30afd26a77b4be312226bba416

PTRACE_O_TRACESYSGOOD was supported at least as of this change, in 2002:

  https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=acc7088569c8eef04eeed0eff51d23bb5bcff964

PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK, PTRACE_O_TRACEEXEC and
PTRACE_O_TRACECLONE were introduced in this change, in 2002:

  https://git.kernel.org/pub/scm/linux/kernel/git/tglx/history.git/commit/?id=a0691b116f6a4473f0fa264210ab9b95771a2b46

Change-Id: Iffb906549a89cc6b619427f976ec044706ab1e8d
gdb/linux-nat.c
gdb/nat/linux-ptrace.c
gdb/nat/linux-ptrace.h
gdbserver/linux-low.cc