public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well
@ 2024-04-23 16:56 Aditya Kamath1
  2024-04-25 13:51 ` Tom Tromey
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Kamath1 @ 2024-04-23 16:56 UTC (permalink / raw)
  To: Tom Tromey, Ulrich Weigand, Aditya Kamath1 via Gdb-patches

[-- 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well
  2024-04-23 16:56 [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well Aditya Kamath1
@ 2024-04-25 13:51 ` Tom Tromey
  2024-04-29  2:00   ` Aditya Kamath1
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2024-04-25 13:51 UTC (permalink / raw)
  To: Aditya Kamath1; +Cc: Tom Tromey, Ulrich Weigand, Aditya Kamath1 via Gdb-patches

> 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.

Sounds good.

> Let me know what you think. Kindly apply this patch if it is okay.

It would be more convenient if you sent patches with 'git send-email'.
Something mangled this one so it can't really be directly applied.

Tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well
  2024-04-25 13:51 ` Tom Tromey
@ 2024-04-29  2:00   ` Aditya Kamath1
  0 siblings, 0 replies; 5+ messages in thread
From: Aditya Kamath1 @ 2024-04-29  2:00 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Tom Tromey, Ulrich Weigand, Aditya Kamath1 via Gdb-patches

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

>It would be more convenient if you sent patches with 'git send-email'.
>Something mangled this one so it can't really be directly applied.

I have sent the patch in another email using git send-email. Kindly apply the same. It will be in another thread named with subject “[EXTERNAL] [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well”.

I will send all the GDB patches using git-send email from here on.

Kindly let me know if anything needed.

Have a nice day ahead.

Thanks and regards,
Aditya.

From: Tom Tromey <tom@tromey.com>
Date: Thursday, 25 April 2024 at 7:21 PM
To: Aditya Kamath1 <Aditya.Kamath1@ibm.com>
Cc: Tom Tromey <tom@tromey.com>, Ulrich Weigand <Ulrich.Weigand@de.ibm.com>, Aditya Kamath1 via Gdb-patches <gdb-patches@sourceware.org>
Subject: [EXTERNAL] Re: [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well
> 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.

Sounds good.

> Let me know what you think. Kindly apply this patch if it is okay.

It would be more convenient if you sent patches with 'git send-email'.
Something mangled this one so it can't really be directly applied.

Tom

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well
  2024-04-29  1:48 Aditya Vidyadhar Kamath
@ 2024-05-02  1:57 ` Kevin Buettner
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Buettner @ 2024-05-02  1:57 UTC (permalink / raw)
  To: Aditya Vidyadhar Kamath
  Cc: gdb-patches, tom, ulrich.weigand, Aditya Vidyadhar Kamath

On Mon, 29 Apr 2024 07:18:57 +0530
Aditya Vidyadhar Kamath <akamath996@gmail.com> wrote:

> From: Aditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com>
> 
> ---
>  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
>  }
>  

Could you update the comment to indicate that it's been verified to
work with (both) Linux and AIX targets?

Once that's done, you have my approval:

Approved-by: Kevin Buettner <kevinb@redhat.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well
@ 2024-04-29  1:48 Aditya Vidyadhar Kamath
  2024-05-02  1:57 ` Kevin Buettner
  0 siblings, 1 reply; 5+ messages in thread
From: Aditya Vidyadhar Kamath @ 2024-04-29  1:48 UTC (permalink / raw)
  To: tom; +Cc: ulrich.weigand, gdb-patches, Aditya Vidyadhar Kamath

From: Aditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com>

---
 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-02  1:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-23 16:56 [PATCH] Add gdb.threads/thread_events.exp to run in AIX as well Aditya Kamath1
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

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).