From: Simon Marchi Date: Mon, 17 Nov 2025 17:57:32 +0000 (-0500) Subject: gdb/netbsd: fix fallout of thread_info ptr to ref change X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed3ecf26816843e3c78a56a9b5c77cce666cdf77;p=thirdparty%2Fbinutils-gdb.git gdb/netbsd: fix fallout of thread_info ptr to ref change 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 --- diff --git a/gdb/netbsd-nat.c b/gdb/netbsd-nat.c index 3e54f0796ce..338c372a4d5 100644 --- a/gdb/netbsd-nat.c +++ b/gdb/netbsd-nat.c @@ -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")); }