static char *dummy_make_corefile_notes (struct target_ops *self,
bfd *ignore1, int *ignore2);
-static const char *default_pid_to_str (struct target_ops *ops, ptid_t ptid);
+static std::string default_pid_to_str (struct target_ops *ops, ptid_t ptid);
static enum exec_direction_kind default_execution_direction
(struct target_ops *self);
" thread-local variables in\n"
"the shared library `%s'\n"
"for %s"),
- objfile_name (objfile), target_pid_to_str (ptid));
+ objfile_name (objfile),
+ target_pid_to_str (ptid).c_str ());
else
error (_("The inferior has not yet allocated storage for"
" thread-local variables in\n"
"the executable `%s'\n"
"for %s"),
- objfile_name (objfile), target_pid_to_str (ptid));
+ objfile_name (objfile),
+ target_pid_to_str (ptid).c_str ());
break;
case TLS_GENERIC_ERROR:
if (objfile_is_library)
error (_("Cannot find thread-local storage for %s, "
"shared library %s:\n%s"),
- target_pid_to_str (ptid),
+ target_pid_to_str (ptid).c_str (),
objfile_name (objfile), ex.message);
else
error (_("Cannot find thread-local storage for %s, "
"executable file %s:\n%s"),
- target_pid_to_str (ptid),
+ target_pid_to_str (ptid).c_str (),
objfile_name (objfile), ex.message);
break;
default:
return minus_one_ptid;
}
-const char *
+std::string
target_pid_to_str (ptid_t ptid)
{
return current_top_target ()->pid_to_str (ptid);
pid = inferior_ptid.pid ();
printf_unfiltered (_("Detaching from program: %s, %s\n"), exec_file,
- target_pid_to_str (ptid_t (pid)));
+ target_pid_to_str (ptid_t (pid)).c_str ());
}
/* The inferior process has died. Long live the inferior! */
/* Convert a normal process ID to a string. Returns the string in a
static buffer. */
-const char *
+std::string
normal_pid_to_str (ptid_t ptid)
{
- static char buf[32];
-
- xsnprintf (buf, sizeof buf, "process %d", ptid.pid ());
- return buf;
+ return string_printf ("process %d", ptid.pid ());
}
-static const char *
+static std::string
default_pid_to_str (struct target_ops *ops, ptid_t ptid)
{
return normal_pid_to_str (ptid);