]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/target.c
gdb
[thirdparty/binutils-gdb.git] / gdb / target.c
index 32da4dd0e6cde079c45add2659011072a15f7a65..710af02c7dc30c00f00ffa89438929f1d57997df 100644 (file)
@@ -634,6 +634,7 @@ update_current_target (void)
       /* Do not inherit to_find_new_threads.  */
       /* Do not inherit to_pid_to_str.  */
       INHERIT (to_extra_thread_info, t);
+      INHERIT (to_thread_name, t);
       INHERIT (to_stop, t);
       /* Do not inherit to_xfer_partial.  */
       INHERIT (to_rcmd, t);
@@ -804,6 +805,9 @@ update_current_target (void)
   de_fault (to_extra_thread_info,
            (char *(*) (struct thread_info *))
            return_zero);
+  de_fault (to_thread_name,
+           (char *(*) (struct thread_info *))
+           return_zero);
   de_fault (to_stop,
            (void (*) (ptid_t))
            target_ignore);
@@ -2407,6 +2411,20 @@ target_pid_to_str (ptid_t ptid)
   return normal_pid_to_str (ptid);
 }
 
+char *
+target_thread_name (struct thread_info *info)
+{
+  struct target_ops *t;
+
+  for (t = current_target.beneath; t != NULL; t = t->beneath)
+    {
+      if (t->to_thread_name != NULL)
+       return (*t->to_thread_name) (info);
+    }
+
+  return NULL;
+}
+
 void
 target_resume (ptid_t ptid, int step, enum target_signal signal)
 {