From: Aditya Vidyadhar Kamath <akamath996@gmail.com>
To: ulrich.weigand@de.ibm.com, tom@tromey.com
Cc: gdb-patches@sourceware.org, Aditya.Kamath1@ibm.com,
sangamesh.swamy@in.ibm.com,
Aditya Vidyadhar Kamath <aditya.kamath1@ibm.com>
Subject: [PATCH] Fix AIX CI build break.
Date: Fri, 10 Oct 2025 16:06:39 +0530 [thread overview]
Message-ID: <20251010103638.51128-2-akamath996@gmail.com> (raw)
From: Aditya Vidyadhar Kamath <aditya.kamath1@ibm.com>
Recently AIX internal CI is broken.
The error is as follows:
--------------------------------
aix-thread.c: In function 'void sync_threadlists(pid_t)':
aix-thread.c:857:53: error: cannot convert 'thread_info' to 'thread_info*' in initialization
857 | for (struct thread_info *it : all_threads_safe ())
| ^
aix-thread.c: In lambda function:
aix-thread.c:899:61: warning: declaration of 'thread' shadows a previous local [-Wshadow=compatible-local]
899 | thread = iterate_over_threads ([&] (struct thread_info *thread)
----------------------------------
This patch is similar to the commit https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=675a17a8a5cde1d8be86536df2ae6366ef0ec759
all_threads_safe() returns an all_threads_safe_range which is like an iterator to iterate for loops.
AIX is adjusting its code in aix-thread.c for the same.
After applying this patch,
Sample test case output:
------------
gmake check RUNTESTFLAGS='gdb.threads/thread_events.exp CC_FOR_TARGET="/opt/freeware/bin/gcc" CXX_FOR_TARGET="/opt/freeware/bin/g++" CXXFLAGS_FOR_TARGET="-O0 -w -g -gdwarf -maix64" CFLAGS_FOR_TARGET="-O0 -w -g -gdwarf -maix64"'
gmake check-single
gmake[1]: Entering directory '/upstream_gdb/binutils-gdb/gdb/testsuite'
rm -f *core* gdb.sum gdb.log
=== gdb tests ===
Schedule of variations:
unix
Running target unix
Using /opt/freeware/share/dejagnu/baseboards/unix.exp as board description file for target.
Using /opt/freeware/share/dejagnu/config/unix.exp as generic interface file for target.
Using /upstream_gdb/binutils-gdb/gdb/testsuite/config/unix.exp as tool-and-target-specific interface file.
Running /upstream_gdb/binutils-gdb/gdb/testsuite/gdb.threads/thread_events.exp ...
=== gdb Summary ===
/upstream_gdb/binutils-gdb/gdb/gdb version 18.0.50.20251010-git -nw -nx -q -iex "set height 0" -iex "set width 0" -data-directory /upstream_gdb/binutils-gdb/gdb/data-directory -iex "set interactive-mode on"
=== gdb Summary ===
/upstream_gdb/binutils-gdb/gdb/gdb version 18.0.50.20251010-git -nw -nx -q -iex "set height 0" -iex "set width 0" -data-directory /upstream_gdb/binutils-gdb/gdb/data-directory -iex "set interactive-mode on"
gmake[1]: Leaving directory '/upstream_gdb/binutils-gdb/gdb/testsuite'
----------------
---
gdb/aix-thread.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 1e3015d77b0..7007f76b85a 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -854,14 +854,14 @@ sync_threadlists (pid_t pid)
thread exits and gets into a PST_UNKNOWN state. So this thread
will not run in the above for loop. Therefore the below for loop
is to manually delete such threads. */
- for (struct thread_info *it : all_threads_safe ())
+ for (thread_info &it : all_threads_safe ())
{
- aix_thread_info *priv = get_aix_thread_info (it);
+ aix_thread_info *priv = get_aix_thread_info (&it);
if (in_queue_threads.count (priv->pdtid) == 0
- && in_thread_list (proc_target, it->ptid)
- && pid == it->ptid.pid ())
+ && in_thread_list (proc_target, it.ptid)
+ && pid == it.ptid.pid ())
{
- delete_thread (it);
+ delete_thread (&it);
data->exited_threads.insert (priv->pdtid);
}
}
--
2.41.0
next reply other threads:[~2025-10-10 10:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-10 10:36 Aditya Vidyadhar Kamath [this message]
2025-10-10 10:52 ` Ulrich Weigand
-- strict thread matches above, loose matches on Subject: below --
2025-01-13 4:43 Aditya Vidyadhar Kamath
2025-01-13 9:08 ` Tom Tromey
2025-01-13 10:35 ` Aditya Kamath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251010103638.51128-2-akamath996@gmail.com \
--to=akamath996@gmail.com \
--cc=Aditya.Kamath1@ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=sangamesh.swamy@in.ibm.com \
--cc=tom@tromey.com \
--cc=ulrich.weigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox