ptrace on FreeBSD cannot be used against running processes and instead
fails with EBUSY. This meant that 'info threads' would fail if any of
the threads were running (for example when using schedule-multiple=on
in gdb.base/fork-running-state.exp). Instead of throwing errors, just
return nullptr as no thread name is better than causing info threads to
fail completely.
if a name has not been set explicitly. Return a NULL name in
that case. */
if (!fbsd_fetch_kinfo_proc (pid, &kp))
- perror_with_name (_("Failed to fetch process information"));
+ return nullptr;
if (ptrace (PT_LWPINFO, lwp, (caddr_t) &pl, sizeof pl) == -1)
- perror_with_name (("ptrace (PT_LWPINFO)"));
+ return nullptr;
if (strcmp (kp.ki_comm, pl.pl_tdname) == 0)
return NULL;
xsnprintf (buf, sizeof buf, "%s", pl.pl_tdname);