]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/netbsd: fix fallout of thread_info ptr to ref change
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 17 Nov 2025 17:57:32 +0000 (12:57 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 17 Nov 2025 17:57:32 +0000 (12:57 -0500)
Fix:

  CXX    netbsd-nat.o
/home/smarchi/src/binutils-gdb/gdb/netbsd-nat.c: In function 'void nbsd_resume(nbsd_nat_target*, ptid_t, int, gdb_signal)':
/home/smarchi/src/binutils-gdb/gdb/netbsd-nat.c:481:10: error: base operand of '->' has non-pointer type 'thread_info'
  481 |    if (tp->ptid.lwp () == ptid.lwp ())
      |          ^~

... following the changes that made thread iterators yield references
instead of points (e.g. 1ad8737b3c5 ("gdb: change inf_threads_iterator
to yield references")).

Change-Id: I6b96d1a81fbe8792e82e071c4871f0f212d2e49d

gdb/netbsd-nat.c

index 3e54f0796ce9163c5dfe6fb408c2cc4a6d890980..338c372a4d55b5a7afc8a0d9e00a06cf8d7d56a1 100644 (file)
@@ -478,12 +478,12 @@ nbsd_resume(nbsd_nat_target *target, ptid_t ptid, int step,
 
       for (thread_info &tp : inf->non_exited_threads ())
        {
-         if (tp->ptid.lwp () == ptid.lwp ())
+         if (tp.ptid.lwp () == ptid.lwp ())
            request = PT_RESUME;
          else
            request = PT_SUSPEND;
 
-         if (ptrace (request, tp->ptid.pid (), NULL, tp->ptid.lwp ()) == -1)
+         if (ptrace (request, tp.ptid.pid (), NULL, tp.ptid.lwp ()) == -1)
            perror_with_name (("ptrace"));
        }
     }
@@ -492,20 +492,20 @@ nbsd_resume(nbsd_nat_target *target, ptid_t ptid, int step,
       /* If ptid is a wildcard, resume all matching threads (they won't run
         until the process is continued however).  */
       for (thread_info &tp : all_non_exited_threads (target, ptid))
-       if (ptrace (PT_RESUME, tp->ptid.pid (), NULL, tp->ptid.lwp ()) == -1)
+       if (ptrace (PT_RESUME, tp.ptid.pid (), NULL, tp.ptid.lwp ()) == -1)
          perror_with_name (("ptrace"));
     }
 
   if (step)
     {
       for (thread_info &tp : all_non_exited_threads (target, ptid))
-       if (ptrace (PT_SETSTEP, tp->ptid.pid (), NULL, tp->ptid.lwp ()) == -1)
+       if (ptrace (PT_SETSTEP, tp.ptid.pid (), NULL, tp.ptid.lwp ()) == -1)
          perror_with_name (("ptrace"));
     }
   else
     {
       for (thread_info &tp : all_non_exited_threads (target, ptid))
-       if (ptrace (PT_CLEARSTEP, tp->ptid.pid (), NULL, tp->ptid.lwp ()) == -1)
+       if (ptrace (PT_CLEARSTEP, tp.ptid.pid (), NULL, tp.ptid.lwp ()) == -1)
          perror_with_name (("ptrace"));
     }