diff options
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r-- | gdb/linux-thread-db.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index fd67dcb..186525a 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -95,7 +95,7 @@ public: void resume (ptid_t, int, enum gdb_signal) override; void mourn_inferior () override; void update_thread_list () override; - const char *pid_to_str (ptid_t) override; + std::string pid_to_str (ptid_t) override; CORE_ADDR get_thread_local_address (ptid_t ptid, CORE_ADDR load_module_addr, CORE_ADDR offset) override; @@ -1631,20 +1631,17 @@ thread_db_target::update_thread_list () this->beneath ()->update_thread_list (); } -const char * +std::string thread_db_target::pid_to_str (ptid_t ptid) { struct thread_info *thread_info = find_thread_ptid (ptid); if (thread_info != NULL && thread_info->priv != NULL) { - static char buf[64]; thread_db_thread_info *priv = get_thread_db_thread_info (thread_info); - snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)", - (unsigned long) priv->tid, ptid.lwp ()); - - return buf; + return string_printf ("Thread 0x%lx (LWP %ld)", + (unsigned long) priv->tid, ptid.lwp ()); } return beneath ()->pid_to_str (ptid); |