Respected Tom, Ulrich and community members, Hi, Please find attached a patch pasted below this email. The gdb.threads/thread_events.exp is a very good testcase that should run in AIX as well. Currently it is not. This test case is a nice test for the issue we are resolving here. [https://sourceware.org/pipermail/gdb-patches/2024-April/208104.html]. I was looking around for a test like this and just figured this out. Since this was not running on AIX we had to write our own to test to solve that issue. Would the community mind if AIX runs this test case as well?? Instead of contributing a new one, this one tests what we are looking for perfectly. So this test has one failure in AIX. === gdb Summary === # of expected passes 10 # of unexpected failures 1 I can tell you why this happened. Reading symbols from testsuite/gdb.threads/thread_events... (gdb) b main Breakpoint 1 at 0x100007dc: file gdb.threads/thread_events.c, line 41. (gdb) b threadfunc Breakpoint 2 at 0x10000718: file gdb.threads/thread_events.c, line 27. (gdb) b after_join_func Breakpoint 3 at 0x10000778: file gdb.threads/thread_events.c, line 34. (gdb) r Starting program: /current_gdb/binutils-gdb/gdb/testsuite/gdb.threads/thread_events Breakpoint 1, main (argc=1, argv=0x2ff22950) at gdb.threads/thread_events.c:41 41 if (pthread_create (&thread, NULL, threadfunc, NULL) != 0) (gdb) c Continuing. [New Thread 258 (tid 30540187)] [Switching to Thread 258 (tid 30540187)] Thread 2 hit Breakpoint 2, threadfunc (arg=0x0) at gdb.threads/thread_events.c:27 27 printf ("in threadfunc\n"); (gdb) c Continuing. in threadfunc [Switching to Thread 1 (tid 31326575)] Thread 1 hit Breakpoint 3, after_join_func () at gdb.threads/thread_events.c:34 34 printf ("finished\n"); (gdb) info threads Id Target Id Frame * 1 Thread 1 (tid 31326575) ([running]) after_join_func () at gdb.threads/thread_events.c:34 2 Thread 258 (tid 30540187) ([unknown]) The last part of the test case is the problem actually. We did not handle unknown state in sync_threadlists (). The thread 258 completed its execution and we did not catch the same. Also, we are not handling unknown state as of now in aix-thread.c. We only handle PST_TERM. Which is the reason for the one failure. Anyway, I will fix it in the other thread. Let me know what you think. Kindly apply this patch if it is okay. Have a nice day ahead. Thanks and regards, Aditya. # cat patches/0001-Add-gdb.threads-thread_events.exp-to-run-in-AIX-as-w.patch From 73dac7610d2ecf3120dc06542a88ff6dc555da71 Mon Sep 17 00:00:00 2001 From: Aditya Vidyadhar Kamath Aditya.Kamath1@ibm.com Date: Mon, 22 Apr 2024 10:32:13 -0500 Subject: [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well --- gdb/testsuite/gdb.threads/thread_events.exp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.threads/thread_events.exp b/gdb/testsuite/gdb.threads/thread_events.exp index 100205e5f58..11a89139384 100644 --- a/gdb/testsuite/gdb.threads/thread_events.exp +++ b/gdb/testsuite/gdb.threads/thread_events.exp @@ -23,7 +23,8 @@ # This test has only been verified with Linux targets, and would need # to be generalized to support other targets -if {![istarget *-*-linux*]} { + +if {!([istarget *-*-linux*] || [istarget *-*-aix*])} { return } -- 2.41.0