aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat/linux-ptrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/nat/linux-ptrace.c')
-rw-r--r--gdb/nat/linux-ptrace.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/nat/linux-ptrace.c b/gdb/nat/linux-ptrace.c
index 9ea0e22..f73058b 100644
--- a/gdb/nat/linux-ptrace.c
+++ b/gdb/nat/linux-ptrace.c
@@ -1,5 +1,5 @@
/* Linux-specific ptrace manipulation routines.
- Copyright (C) 2012-2024 Free Software Foundation, Inc.
+ Copyright (C) 2012-2025 Free Software Foundation, Inc.
This file is part of GDB.
@@ -22,6 +22,8 @@
#ifdef HAVE_SYS_PROCFS_H
#include <sys/procfs.h>
#endif
+#include "gdbsupport/eintr.h"
+#include "gdbsupport/signals-state-save-restore.h"
/* Stores the ptrace options supported by the running kernel.
A value of -1 means we did not check for features yet. A value
@@ -147,6 +149,9 @@ linux_ptrace_test_ret_to_nx (void)
return;
case 0:
+ /* Set signal handlers to their default because it doesn't make sense
+ to call GDB-specific handlers any more in the child process. */
+ restore_original_signals_state ();
l = ptrace (PTRACE_TRACEME, 0, (PTRACE_TYPE_ARG3) NULL,
(PTRACE_TYPE_ARG4) NULL);
if (l != 0)
@@ -177,7 +182,7 @@ linux_ptrace_test_ret_to_nx (void)
}
errno = 0;
- got_pid = waitpid (child, &status, 0);
+ got_pid = gdb::waitpid (child, &status, 0);
if (got_pid != child)
{
warning (_("linux_ptrace_test_ret_to_nx: waitpid returned %ld: %s"),