public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Aditya Kamath1 <Aditya.Kamath1@ibm.com>
To: Tom Tromey <tom@tromey.com>,
	Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	Aditya Kamath1 via Gdb-patches <gdb-patches@sourceware.org>
Subject: [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well
Date: Tue, 23 Apr 2024 16:56:46 +0000	[thread overview]
Message-ID: <CH2PR15MB3544E91B908E5A4F78388236D6122@CH2PR15MB3544.namprd15.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3588 bytes --]

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>. [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<mailto: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

             reply	other threads:[~2024-04-23 16:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-23 16:56 Aditya Kamath1 [this message]
2024-04-25 13:51 ` Tom Tromey
2024-04-29  2:00   ` Aditya Kamath1
2024-04-29  1:48 Aditya Vidyadhar Kamath
2024-05-02  1:57 ` Kevin Buettner

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=CH2PR15MB3544E91B908E5A4F78388236D6122@CH2PR15MB3544.namprd15.prod.outlook.com \
    --to=aditya.kamath1@ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).