* [PATCH] Fix AIX CI build break.
@ 2025-10-10 10:36 Aditya Vidyadhar Kamath
2025-10-10 10:52 ` Ulrich Weigand
0 siblings, 1 reply; 5+ messages in thread
From: Aditya Vidyadhar Kamath @ 2025-10-10 10:36 UTC (permalink / raw)
To: ulrich.weigand, tom
Cc: gdb-patches, Aditya.Kamath1, sangamesh.swamy, Aditya Vidyadhar Kamath
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Fix AIX CI build break.
2025-10-10 10:36 [PATCH] Fix AIX CI build break Aditya Vidyadhar Kamath
@ 2025-10-10 10:52 ` Ulrich Weigand
0 siblings, 0 replies; 5+ messages in thread
From: Ulrich Weigand @ 2025-10-10 10:52 UTC (permalink / raw)
To: akamath996, tom; +Cc: gdb-patches, SANGAMESH MALLAYYA, Aditya Kamath
>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);
> }
> }
This is OK.
Thanks,
Ulrich
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] Fix AIX CI build break.
@ 2025-01-13 4:43 Aditya Vidyadhar Kamath
2025-01-13 9:08 ` Tom Tromey
0 siblings, 1 reply; 5+ messages in thread
From: Aditya Vidyadhar Kamath @ 2025-01-13 4:43 UTC (permalink / raw)
To: ulrich.weigand, tom; +Cc: gdb-patches, Aditya.Kamath1, sangamesh.swamy
From: KamathForAIX <Aditya.Kamath1@ibm.com>
In AIX a recent commit caused a build break with the error as shown below.
In file included from python/py-color.h:23,
from python/python.c:39:
python/python-internal.h:86:10: fatal error: Python.h: No such file or directory
86 | #include <Python.h>
In AIX, we run builds with and without python for our internal CI's.
A feature development made by the recent commit https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=6447969d0ac774b6dec0f95a0d3d27c27d158690
missed to guard Python.h in HAVE_PYTHON macro.
This commit is a fix for the same.
---
gdb/python/python.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 15bb9129739..f647e6aaf4c 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -36,7 +36,10 @@
#include "run-on-main-thread.h"
#include "observable.h"
#include "build-id.h"
+
+#ifdef HAVE_PYTHON
#include "py-color.h"
+#endif /* HAVE_PYTHON */
#if GDB_SELF_TEST
#include "gdbsupport/selftest.h"
--
2.41.0
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] Fix AIX CI build break.
2025-01-13 4:43 Aditya Vidyadhar Kamath
@ 2025-01-13 9:08 ` Tom Tromey
2025-01-13 10:35 ` Aditya Kamath
0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2025-01-13 9:08 UTC (permalink / raw)
To: Aditya Vidyadhar Kamath
Cc: ulrich.weigand, tom, gdb-patches, Aditya.Kamath1, sangamesh.swamy
>>>>> Aditya Vidyadhar Kamath <akamath996@gmail.com> writes:
> A feature development made by the recent commit
> https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=6447969d0ac774b6dec0f95a0d3d27c27d158690
> missed to guard Python.h in HAVE_PYTHON macro.
> This commit is a fix for the same.
Sorry about that.
> +
> +#ifdef HAVE_PYTHON
> #include "py-color.h"
> +#endif /* HAVE_PYTHON */
Rather than a new #ifdef, could you just move the #include into the
already-existing #ifdef block? Thanks.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] Fix AIX CI build break.
2025-01-13 9:08 ` Tom Tromey
@ 2025-01-13 10:35 ` Aditya Kamath
0 siblings, 0 replies; 5+ messages in thread
From: Aditya Kamath @ 2025-01-13 10:35 UTC (permalink / raw)
To: Tom Tromey, Aditya Vidyadhar Kamath
Cc: Ulrich Weigand, tom, gdb-patches, SANGAMESH MALLAYYA
[-- Attachment #1: Type: text/plain, Size: 1247 bytes --]
Hi Tom,
>Rather than a new #ifdef, could you just move the #include into the
>already-existing #ifdef block? Thanks.
Thank you for noticing. I had missed it. I have made the change and sent a v2 of the patch requesting approval to commit.
Have a nice day ahead.
Regards,
Aditya.
From: Tom Tromey <tom@tromey.com>
Date: Monday, 13 January 2025 at 2:38 PM
To: Aditya Vidyadhar Kamath <akamath996@gmail.com>
Cc: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>, tom@tromey.com <tom@tromey.com>, gdb-patches@sourceware.org <gdb-patches@sourceware.org>, Aditya Kamath <Aditya.Kamath1@ibm.com>, SANGAMESH MALLAYYA <sangamesh.swamy@in.ibm.com>
Subject: [EXTERNAL] Re: [PATCH] Fix AIX CI build break.
>>>>> Aditya Vidyadhar Kamath <akamath996@gmail.com> writes:
> A feature development made by the recent commit
> https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=6447969d0ac774b6dec0f95a0d3d27c27d158690
> missed to guard Python.h in HAVE_PYTHON macro.
> This commit is a fix for the same.
Sorry about that.
> +
> +#ifdef HAVE_PYTHON
> #include "py-color.h"
> +#endif /* HAVE_PYTHON */
Rather than a new #ifdef, could you just move the #include into the
already-existing #ifdef block? Thanks.
Tom
[-- Attachment #2: Type: text/html, Size: 4195 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-10-10 10:52 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-10 10:36 [PATCH] Fix AIX CI build break Aditya Vidyadhar Kamath
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox