+2019-11-26 Christian Biesinger <cbiesinger@google.com>
+
+ * linux-nat.c (detach_one_lwp): Call safe_strerror instead of
+ strerror.
+ * nto-procfs.c (nto_procfs_target::create_inferior): Likewise.
+ * windows-nat.c (windows_nat_target::create_inferior): Likewise.
+
2019-11-25 Tom de Vries <tdevries@suse.de>
* contrib/words.sh: Add -c option.
+2019-11-26 Christian Biesinger <cbiesinger@google.com>
+
+ * debug.c (debug_set_output): Call safe_strerror instead of
+ strerror.
+ * linux-low.c (attach_proc_task_lwp_callback): Likewise.
+ (linux_kill_one_lwp): Likewise.
+ (linux_detach_one_lwp): Likewise.
+ (linux_wait_for_event_filtered): Likewise.
+ (store_register): Likewise.
+ * lynx-low.c (lynx_attach): Likewise.
+ * mem-break.c (insert_memory_breakpoint): Likewise.
+ (remove_memory_breakpoint): Likewise.
+ (delete_fast_tracepoint_jump): Likewise.
+ (set_fast_tracepoint_jump): Likewise.
+ (uninsert_fast_tracepoint_jumps_at): Likewise.
+ (reinsert_fast_tracepoint_jumps_at): Likewise.
+ * nto-low.c (nto_xfer_memory): Likewise.
+ (nto_resume): Likewise.
+
2019-11-20 Luis Machado <luis.machado@linaro.org>
* linux-aarch64-low.c (is_sve_tdesc): Check against target feature
if (fptr == nullptr)
{
debug_printf ("Cannot open %s for writing. %s. Switching to stderr.\n",
- new_debug_file, strerror (errno));
+ new_debug_file, safe_strerror (errno));
return;
}
{
debug_printf ("Cannot attach to lwp %d: "
"thread is gone (%d: %s)\n",
- lwpid, err, strerror (err));
+ lwpid, err, safe_strerror (err));
}
}
else if (err != 0)
debug_printf ("LKL: kill_lwp (SIGKILL) %s, 0, 0 (%s)\n",
target_pid_to_str (ptid_of (thr)),
- save_errno ? strerror (save_errno) : "OK");
+ save_errno ? safe_strerror (save_errno) : "OK");
}
errno = 0;
debug_printf ("LKL: PTRACE_KILL %s, 0, 0 (%s)\n",
target_pid_to_str (ptid_of (thr)),
- save_errno ? strerror (save_errno) : "OK");
+ save_errno ? safe_strerror (save_errno) : "OK");
}
}
if (ret == -1)
{
warning (_("Couldn't reap LWP %d while detaching: %s"),
- lwpid, strerror (errno));
+ lwpid, safe_strerror (errno));
}
else if (!WIFEXITED (status) && !WIFSIGNALED (status))
{
{
error (_("Can't detach %s: %s"),
target_pid_to_str (ptid_of (thread)),
- strerror (save_errno));
+ safe_strerror (save_errno));
}
}
else if (debug_threads)
if (debug_threads)
debug_printf ("LWFE: waitpid(-1, ...) returned %d, %s\n",
- ret, errno ? strerror (errno) : "ERRNO-OK");
+ ret, errno ? safe_strerror (errno) : "ERRNO-OK");
if (ret > 0)
{
return;
if ((*the_low_target.cannot_store_register) (regno) == 0)
- error ("writing register %d: %s", regno, strerror (errno));
+ error ("writing register %d: %s", regno, safe_strerror (errno));
}
regaddr += sizeof (PTRACE_XFER_TYPE);
}
if (lynx_ptrace (PTRACE_ATTACH, ptid, 0, 0, 0) != 0)
error ("Cannot attach to process %lu: %s (%d)\n", pid,
- strerror (errno), errno);
+ safe_strerror (errno), errno);
lynx_add_process (pid, 1);
lynx_add_threads_after_attach (pid);
if (debug_threads)
debug_printf ("Failed to read shadow memory of"
" breakpoint at 0x%s (%s).\n",
- paddress (bp->pc), strerror (err));
+ paddress (bp->pc), safe_strerror (err));
}
else
{
{
if (debug_threads)
debug_printf ("Failed to insert breakpoint at 0x%s (%s).\n",
- paddress (bp->pc), strerror (err));
+ paddress (bp->pc), safe_strerror (err));
}
}
return err != 0 ? -1 : 0;
if (debug_threads)
debug_printf ("Failed to uninsert raw breakpoint "
"at 0x%s (%s) while deleting it.\n",
- paddress (bp->pc), strerror (err));
+ paddress (bp->pc), safe_strerror (err));
}
return err != 0 ? -1 : 0;
}
if (debug_threads)
debug_printf ("Failed to uninsert fast tracepoint jump "
"at 0x%s (%s) while deleting it.\n",
- paddress (bp->pc), strerror (ret));
+ paddress (bp->pc), safe_strerror (ret));
return ret;
}
if (debug_threads)
debug_printf ("Failed to read shadow memory of"
" fast tracepoint at 0x%s (%s).\n",
- paddress (where), strerror (err));
+ paddress (where), safe_strerror (err));
free (jp);
return NULL;
}
{
if (debug_threads)
debug_printf ("Failed to insert fast tracepoint jump at 0x%s (%s).\n",
- paddress (where), strerror (err));
+ paddress (where), safe_strerror (err));
/* Unlink it. */
proc->fast_tracepoint_jumps = jp->next;
if (debug_threads)
debug_printf ("Failed to uninsert fast tracepoint jump at"
" 0x%s (%s).\n",
- paddress (pc), strerror (err));
+ paddress (pc), safe_strerror (err));
}
}
}
if (debug_threads)
debug_printf ("Failed to reinsert fast tracepoint jump at"
" 0x%s (%s).\n",
- paddress (where), strerror (err));
+ paddress (where), safe_strerror (err));
}
}
if (nbytes == 0)
{
int e = errno;
- TRACE ("Error in %s : errno=%d (%s)\n", __func__, e, strerror (e));
+ TRACE ("Error in %s : errno=%d (%s)\n", __func__, e, safe_strerror (e));
}
return nbytes;
}
err = devctl (nto_inferior.ctl_fd, DCMD_PROC_RUN, &run, sizeof (run), 0);
if (err != EOK)
- TRACE ("Error: %d \"%s\"\n", err, strerror (err));
+ TRACE ("Error: %d \"%s\"\n", err, safe_strerror (err));
}
/* Wait for inferior's event.
if (ret == -1)
{
warning (_("Couldn't reap LWP %d while detaching: %s"),
- lwpid, strerror (errno));
+ lwpid, safe_strerror (errno));
}
else if (!WIFEXITED (status) && !WIFSIGNALED (status))
{
{
/* FIXME: expected warning? */
/* warning( "Failed to set Kill-on-Last-Close flag: errno = %d(%s)\n",
- errn, strerror(errn) ); */
+ errn, safe_strerror(errn) ); */
}
if (!target_is_pushed (ops))
push_target (ops);
redirect_inferior_handles (allargs, allargs_copy,
&fd_inp, &fd_out, &fd_err);
if (errno)
- warning (_("Error in redirection: %s."), strerror (errno));
+ warning (_("Error in redirection: %s."), safe_strerror (errno));
else
errno = e;
allargs_len = strlen (allargs_copy);