- if (ptid_get_pid (lwp) == -1)
- xsnprintf (buf, sizeof (buf), "Thread %ld (defunct)",
- ptid_get_tid (ptid));
- else if (ptid_get_pid (lwp) != -2)
- xsnprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)",
- ptid_get_tid (ptid), ptid_get_lwp (lwp));
+ if (lwp.pid () == -1)
+ return string_printf ("Thread %ld (defunct)",
+ ptid.tid ());
+ else if (lwp.pid () != -2)
+ return string_printf ("Thread %ld (LWP %ld)",
+ ptid.tid (), lwp.lwp ());