summaryrefslogtreecommitdiff
path: root/gdbserver/linux-low.cc
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2022-01-15 23:25:59 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2022-02-10 20:10:12 -0500
commita288518611dbda5cfae8894d532cf1040cb1b6c2 (patch)
tree8a08bcc229f42cc2f6e64f2045d5225dcaabb06b /gdbserver/linux-low.cc
parenta9dce16586c147c024b49604aa0603d772372f31 (diff)
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
Diffstat (limited to 'gdbserver/linux-low.cc')
-rw-r--r--gdbserver/linux-low.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index cf73bbc70e..30552da755 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -5883,7 +5883,7 @@ linux_process_target::supports_multi_process ()
bool
linux_process_target::supports_fork_events ()
{
- return linux_supports_tracefork ();
+ return true;
}
/* Check if vfork events are supported. */
@@ -5891,7 +5891,7 @@ linux_process_target::supports_fork_events ()
bool
linux_process_target::supports_vfork_events ()
{
- return linux_supports_tracefork ();
+ return true;
}
/* Check if exec events are supported. */
@@ -5899,7 +5899,7 @@ linux_process_target::supports_vfork_events ()
bool
linux_process_target::supports_exec_events ()
{
- return linux_supports_traceexec ();
+ return true;
}
/* Target hook for 'handle_new_gdb_connection'. Causes a reset of the
@@ -6098,8 +6098,7 @@ linux_process_target::read_loadmap (const char *annex, CORE_ADDR offset,
bool
linux_process_target::supports_catch_syscall ()
{
- return (low_supports_catch_syscall ()
- && linux_supports_tracesysgood ());
+ return low_supports_catch_syscall ();
}
bool