Change pid_to_str to return std::string
[deliverable/binutils-gdb.git] / gdb / ravenscar-thread.c
index cb4f26a3472457e04ec1e39989213d02f9ac36a4..6636a89554b29ed488182a9a99afe9b59f2927bb 100644 (file)
@@ -110,7 +110,7 @@ struct ravenscar_thread_target final : public target_ops
 
   const char *extra_thread_info (struct thread_info *) 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;
 
@@ -406,13 +406,10 @@ ravenscar_thread_target::thread_alive (ptid_t ptid)
   return true;
 }
 
-const char *
+std::string
 ravenscar_thread_target::pid_to_str (ptid_t ptid)
 {
-  static char buf[30];
-
-  snprintf (buf, sizeof (buf), "Thread %#x", (int) ptid.tid ());
-  return buf;
+  return string_printf ("Thread %#x", (int) ptid.tid ());
 }
 
 void
This page took 0.025526 seconds and 4 git commands to generate.