X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Faix-thread.c;h=35b77fe4ec0c719d41344c02c7ab2839f8f91c9c;hb=8d70a9f0938b9e9efc4fd2eee80cf806b5e97a4a;hp=655c085734c1326b83081774d36784b88fdb77b6;hpb=143420fb0d5ae54323ba9953f0818c194635228d;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 655c085734..35b77fe4ec 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -61,7 +61,7 @@ extern int getthrds (pid_t, struct thrdsinfo64 *, int, tid_t *, int); #endif /* Whether to emit debugging output. */ -static int debug_aix_thread; +static bool debug_aix_thread; /* In AIX 5.1, functions use pthdb_tid_t instead of tid_t. */ #ifndef PTHDB_VERSION_3 @@ -140,7 +140,7 @@ public: bool thread_alive (ptid_t ptid) override; - const char *pid_to_str (ptid_t) override; + std::string pid_to_str (ptid_t) override; const char *extra_thread_info (struct thread_info *) override; @@ -1746,20 +1746,13 @@ aix_thread_target::thread_alive (ptid_t ptid) /* Return a printable representation of composite PID for use in "info threads" output. */ -const char * +std::string aix_thread_target::pid_to_str (ptid_t ptid) { - static char *ret = NULL; - if (!PD_TID (ptid)) return beneath ()->pid_to_str (ptid); - /* Free previous return value; a new one will be allocated by - xstrprintf(). */ - xfree (ret); - - ret = xstrprintf (_("Thread %ld"), ptid.tid ()); - return ret; + return string_printf (_("Thread %ld"), ptid.tid ()); } /* Return a printable representation of extra information about