gdb/aix: pass "this" to all_inferiors in aix_thread_target::update_thread_list

Message ID 20260324163426.177666-1-simon.marchi@efficios.com
State New
Headers
Series gdb/aix: pass "this" to all_inferiors in aix_thread_target::update_thread_list |

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-arm success Test passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Test passed

Commit Message

Simon Marchi March 24, 2026, 4:34 p.m. UTC
  This is a multi-target correctness fix I spotted this while reviewing
another patch.  The target should only iterate on its own inferiors
here.  Pass "this" to all_inferiors to do so.

Also, switch to all_non_exited_inferiors, which does the same thing as
the "pid == 0" check.

Change-Id: I7aa56ec09eff8934ca056fa90fb4bcb305568e53
---
 gdb/aix-thread.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)


base-commit: 07519d531b1e858f665ff011d7f1002f38111ec8
  

Patch

diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index c2e6b6d2bd6f..e0b3f40572e1 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -925,13 +925,8 @@  pd_activate (pid_t pid)
 void
 aix_thread_target::update_thread_list ()
 {
-  for (inferior *inf : all_inferiors ())
-    {
-      if (inf->pid == 0)
-	continue;
-
-      pd_update (inf->pid);
-    }
+  for (inferior *inf : all_non_exited_inferiors (this))
+    pd_update (inf->pid);
 }