gdbserver: fix build on NetBSD

Message ID 20250319050940.3232127-1-wsh@iij.ad.jp
State New
Headers
Series gdbserver: fix build on NetBSD |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Patch failed to apply

Commit Message

Wataru Ashihara March 19, 2025, 5:09 a.m. UTC
  The function remove_thread() was changed to a method in 2500e7d7d (gdbserver:
make remove_thread a method of process_info).

Signed-off-by: Wataru Ashihara <wsh@iij.ad.jp>
---
 gdbserver/netbsd-low.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

Simon Marchi March 19, 2025, 2:19 p.m. UTC | #1
On 2025-03-19 01:09, Wataru Ashihara wrote:
> The function remove_thread() was changed to a method in 2500e7d7d (gdbserver:
> make remove_thread a method of process_info).
> 
> Signed-off-by: Wataru Ashihara <wsh@iij.ad.jp>
> ---
>  gdbserver/netbsd-low.cc | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/gdbserver/netbsd-low.cc b/gdbserver/netbsd-low.cc
> index 9e7314b02a9..d17c76d91ba 100644
> --- a/gdbserver/netbsd-low.cc
> +++ b/gdbserver/netbsd-low.cc
> @@ -453,7 +453,10 @@ netbsd_process_target::detach (process_info *process)
>  void
>  netbsd_process_target::mourn (struct process_info *proc)
>  {
> -  proc->for_each_thread (remove_thread);
> +  proc->for_each_thread ([proc] (thread_info *thread)
> +    {
> +      proc->remove_thread(thread);
> +    });
>  
>    remove_process (proc);
>  }

Thanks, I pushed this patch (after adding a space after `remove_thread`.

Simon
  

Patch

diff --git a/gdbserver/netbsd-low.cc b/gdbserver/netbsd-low.cc
index 9e7314b02a9..d17c76d91ba 100644
--- a/gdbserver/netbsd-low.cc
+++ b/gdbserver/netbsd-low.cc
@@ -453,7 +453,10 @@  netbsd_process_target::detach (process_info *process)
 void
 netbsd_process_target::mourn (struct process_info *proc)
 {
-  proc->for_each_thread (remove_thread);
+  proc->for_each_thread ([proc] (thread_info *thread)
+    {
+      proc->remove_thread(thread);
+    });
 
   remove_process (proc);
 }