/* Low-level child interface to ptrace.
- Copyright (C) 1988-2019 Free Software Foundation, Inc.
+ Copyright (C) 1988-2020 Free Software Foundation, Inc.
This file is part of GDB.
#endif /* PT_GET_PROCESS_STATE */
\f
-/* Default method for "inf_ptrace_me_fail_reason", which returns an
- empty string. */
-
-static std::string
-default_inf_ptrace_me_fail_reason (int err)
-{
- return {};
-}
-
-/* See inf-ptrace.h. */
-
-std::string (*inf_ptrace_me_fail_reason) (int err)
- = default_inf_ptrace_me_fail_reason;
-
/* Prepare to be traced. */
static void
{
/* "Trace me, Dr. Memory!" */
if (ptrace (PT_TRACE_ME, 0, (PTRACE_TYPE_ARG3) 0, 0) < 0)
- trace_start_error_with_name ("ptrace",
- inf_ptrace_me_fail_reason (errno).c_str ());
+ trace_start_error_with_name ("ptrace");
}
/* Start a new inferior Unix child process. EXEC_FILE is the file to
void
inf_ptrace_target::attach (const char *args, int from_tty)
{
- char *exec_file;
pid_t pid;
struct inferior *inf;
if (from_tty)
{
- exec_file = get_exec_file (0);
+ const char *exec_file = get_exec_file (0);
if (exec_file)
printf_unfiltered (_("Attaching to program: %s, %s\n"), exec_file,