diff options
Diffstat (limited to 'gdb/inf-ptrace.c')
-rw-r--r-- | gdb/inf-ptrace.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index acb80af..efa269c 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -1,6 +1,6 @@ /* Low-level child interface to ptrace. - Copyright (C) 1988-2024 Free Software Foundation, Inc. + Copyright (C) 1988-2025 Free Software Foundation, Inc. This file is part of GDB. @@ -32,6 +32,7 @@ #include "nat/fork-inferior.h" #include "utils.h" #include "gdbarch.h" +#include "gdbsupport/eintr.h" @@ -122,7 +123,7 @@ inf_ptrace_target::mourn_inferior () Do not check whether this succeeds though, since we may be dealing with a process that we attached to. Such a process will only report its exit status to its original parent. */ - waitpid (inferior_ptid.pid (), &status, 0); + gdb::waitpid (inferior_ptid.pid (), &status, 0); inf_child_target::mourn_inferior (); } @@ -141,7 +142,7 @@ inf_ptrace_target::attach (const char *args, int from_tty) pid_t pid = parse_pid_to_attach (args); - if (pid == getpid ()) /* Trying to masturbate? */ + if (pid == getpid ()) error (_("I refuse to debug myself!")); target_unpush_up unpusher; @@ -227,7 +228,7 @@ inf_ptrace_target::kill () return; ptrace (PT_KILL, pid, (PTRACE_TYPE_ARG3)0, 0); - waitpid (pid, &status, 0); + gdb::waitpid (pid, &status, 0); target_mourn_inferior (inferior_ptid); } @@ -307,12 +308,8 @@ inf_ptrace_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, { set_sigint_trap (); - do - { - pid = waitpid (ptid.pid (), &status, options); - save_errno = errno; - } - while (pid == -1 && errno == EINTR); + pid = gdb::waitpid (ptid.pid (), &status, options); + save_errno = errno; clear_sigint_trap (); @@ -475,7 +472,7 @@ inf_ptrace_target::xfer_partial (enum target_object object, case TARGET_OBJECT_AUXV: #if defined (PT_IO) && defined (PIOD_READ_AUXV) /* OpenBSD 4.5 has a new PIOD_READ_AUXV operation for the PT_IO - request that allows us to read the auxilliary vector. Other + request that allows us to read the auxiliary vector. Other BSD's may follow if they feel the need to support PIE. */ { struct ptrace_io_desc piod; |