]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix Solaris build
authorTom Tromey <tromey@adacore.com>
Tue, 10 Jun 2025 13:15:10 +0000 (07:15 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 11 Jun 2025 13:15:20 +0000 (07:15 -0600)
Commit 58984e4a ("Use gdb::function_view in iterate_over_threads")
broke the Solaris build.  This patch attempts to fix it, changing
find_signalled_thread to have the correct signature, and correcting a
couple of problems in sol_thread_target::get_ada_task_ptid.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33073

gdb/procfs.c
gdb/sol-thread.c

index 76a61680d38ac3d3a6b22161a711362bffc186f0..aba2ab9e4776b06ff8d1a91e97d57d2545f01437 100644 (file)
@@ -3550,21 +3550,17 @@ procfs_corefile_thread_callback (procinfo *pi, procinfo *thread, void *data)
   return 0;
 }
 
-static int
-find_signalled_thread (struct thread_info *info, void *data)
+static bool
+find_signalled_thread (struct thread_info *info)
 {
-  if (info->stop_signal () != GDB_SIGNAL_0
-      && info->ptid.pid () == inferior_ptid.pid ())
-    return 1;
-
-  return 0;
+  return (info->stop_signal () != GDB_SIGNAL_0
+         && info->ptid.pid () == inferior_ptid.pid ());
 }
 
 static enum gdb_signal
 find_stop_signal (void)
 {
-  struct thread_info *info =
-    iterate_over_threads (find_signalled_thread, NULL);
+  struct thread_info *info = iterate_over_threads (find_signalled_thread);
 
   if (info)
     return info->stop_signal ();
index ae1e5c0745736f19328c460282a74eb332ef40fd..07e00a21ff79841f96aee4570f094dfb64fd9439 100644 (file)
@@ -1111,19 +1111,21 @@ info_solthreads (const char *args, int from_tty)
 ptid_t
 sol_thread_target::get_ada_task_ptid (long lwp, ULONGEST thread)
 {
-  struct thread_info *thread_info
-    = iterate_over_threads ([&] (struct thread_info *thread)
+  auto thread_db_find_thread_from_tid
+    = [&] (struct thread_info *iter)
        {
-        return thread->ptid.tid () == thread;
-       });
+        return iter->ptid.tid () == thread;
+       };
+
+  struct thread_info *thread_info
+    = iterate_over_threads (thread_db_find_thread_from_tid);
 
   if (thread_info == NULL)
     {
       /* The list of threads is probably not up to date.  Find any
         thread that is missing from the list, and try again.  */
       update_thread_list ();
-      thread_info = iterate_over_threads (thread_db_find_thread_from_tid,
-                                         &thread);
+      thread_info = iterate_over_threads (thread_db_find_thread_from_tid);
     }
 
   gdb_assert (thread_info != NULL);