]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
turn linux-thread-db into a to_xclose target
authorPaul Koning <paul_koning@dell.com>
Tue, 27 Oct 2015 15:55:40 +0000 (11:55 -0400)
committerPaul Koning <paul_koning@dell.com>
Tue, 27 Oct 2015 15:55:40 +0000 (11:55 -0400)
2014-07-29  Tom Tromey  <tromey@redhat.com>

* linux-thread-db.c (thread_db_xclose): New function.
(init_thread_db_ops): Set to_xclose.
(try_thread_db_load_1): Push a new instance of the target.

gdb/linux-thread-db.c

index b77418d37ea0a034b6f535ff3ed08caaf01abe2e..ad767a96233f563cbacfa57af354f13221c0d0d0 100644 (file)
@@ -782,7 +782,7 @@ try_thread_db_load_1 (struct thread_db_info *info)
   /* The thread library was detected.  Activate the thread_db target
      if this is the first process using it.  */
   if (thread_db_list->next == NULL)
-    push_target (&thread_db_ops);
+    push_target (TARGET_NEW (struct target_ops, &thread_db_ops));
 
   /* Enable event reporting, but not when debugging a core file.  */
   if (target_has_execution && thread_db_use_events ())
@@ -2102,12 +2102,23 @@ info_auto_load_libthread_db (char *args, int from_tty)
     ui_out_message (uiout, 0, _("No auto-loaded libthread-db.\n"));
 }
 
+/* to_xclose implementation.  */
+
+static void
+thread_db_xclose (struct target_ops *self)
+{
+  /* Not much to do here, but this method is how we indicate that this
+     target is multi-capable.  */
+  xfree (self);
+}
+
 static void
 init_thread_db_ops (void)
 {
   thread_db_ops.to_shortname = "multi-thread";
   thread_db_ops.to_longname = "multi-threaded child process.";
   thread_db_ops.to_doc = "Threads and pthreads support.";
+  thread_db_ops.to_xclose = thread_db_xclose;
   thread_db_ops.to_detach = thread_db_detach;
   thread_db_ops.to_wait = thread_db_wait;
   thread_db_ops.to_resume = thread_db_resume;