/* Solaris threads debugging interface.
- Copyright (C) 1996-2018 Free Software Foundation, Inc.
+ Copyright (C) 1996-2019 Free Software Foundation, Inc.
This file is part of GDB.
to provide access to the Solaris user-mode thread implementation.
Solaris threads are true user-mode threads, which are invoked via
- the thr_* and pthread_* (native and POSIX respectivly) interfaces.
+ the thr_* and pthread_* (native and POSIX respectively) interfaces.
These are mostly implemented in user-space, with all thread context
kept in various structures that live in the user's heap. These
should not be confused with lightweight processes (LWPs), which are
ptid_t wait (ptid_t, struct target_waitstatus *, int) override;
void resume (ptid_t, int, enum gdb_signal) override;
void mourn_inferior () override;
- const char *pid_to_str (ptid_t) override;
+ std::string pid_to_str (ptid_t) override;
ptid_t get_ada_task_ptid (long lwp, long thread) override;
void fetch_registers (struct regcache *, int) override;
return buf;
}
-/* Return the libthread_db state string assicoated with STATECODE.
+/* Return the libthread_db state string associated with STATECODE.
If STATECODE is unknown, return an appropriate message. */
static const char *
beneath->detach (inf, from_tty);
}
-/* Resume execution of process PTID. If STEP is nozero, then just
+/* Resume execution of process PTID. If STEP is nonzero, then just
single step it. If SIGNAL is nonzero, restart it with that signal
activated. We may have to convert PTID from a thread ID to an LWP
ID for procfs. */
/* Convert PTID to printable form. */
-const char *
+std::string
sol_thread_target::pid_to_str (ptid_t ptid)
{
- static char buf[100];
-
if (ptid.tid_p ())
{
ptid_t lwp;
lwp = thread_to_lwp (ptid, -2);
if (lwp.pid () == -1)
- xsnprintf (buf, sizeof (buf), "Thread %ld (defunct)",
- ptid.tid ());
+ return string_printf ("Thread %ld (defunct)",
+ ptid.tid ());
else if (lwp.pid () != -2)
- xsnprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)",
- ptid.tid (), lwp.lwp ());
+ return string_printf ("Thread %ld (LWP %ld)",
+ ptid.tid (), lwp.lwp ());
else
- xsnprintf (buf, sizeof (buf), "Thread %ld ",
- ptid.tid ());
+ return string_printf ("Thread %ld ",
+ ptid.tid ());
}
else if (ptid.lwp () != 0)
- xsnprintf (buf, sizeof (buf), "LWP %ld ", ptid.lwp ());
+ return string_printf ("LWP %ld ", ptid.lwp ());
else
- xsnprintf (buf, sizeof (buf), "process %d ", ptid.pid ());
-
- return buf;
+ return string_printf ("process %d ", ptid.pid ());
}
\f
printf_filtered (" startfunc=%s",
msym.minsym
- ? MSYMBOL_PRINT_NAME (msym.minsym)
+ ? msym.minsym->print_name ()
: paddress (target_gdbarch (), ti.ti_startfunc));
}
printf_filtered (" sleepfunc=%s",
msym.minsym
- ? MSYMBOL_PRINT_NAME (msym.minsym)
+ ? msym.minsym->print_name ()
: paddress (target_gdbarch (), ti.ti_pc));
}