diff options
author | Aditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com> | 2024-05-03 20:39:54 +0530 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2024-05-08 16:53:03 +0200 |
commit | c70ccf9248cfd460b567c89546e8e1484bcbdcca (patch) | |
tree | fb9918a3729f8f03e16ec635b722343be9a81eb2 /gdb/testsuite | |
parent | 573b697e9dae4ae8b0facfd8336c0c96ec50be5a (diff) | |
download | gdb-c70ccf9248cfd460b567c89546e8e1484bcbdcca.zip gdb-c70ccf9248cfd460b567c89546e8e1484bcbdcca.tar.gz gdb-c70ccf9248cfd460b567c89546e8e1484bcbdcca.tar.bz2 |
Fix AIX thread exit events not being reported and UI to show kernel thread ID.
In AIX when a thread exits we were not showing that a thread exit event happened
and GDB continued to keep the terminated threads.
If we have terminated threads then the UI on info threads command will look like
(gdb) info threads
Id Target Id Frame
* 1 Thread 1 (tid 26607979, running) 0xd0611d70 in _p_nsleep () from /usr/lib/libpthreads.a(_shr_xpg5.o)
2 Thread 258 (tid 30998799, finished) aix-thread: ptrace (52, 30998799) returned -1 (errno = 3 The process does not exist.)
If we see the frame is not getting displayed correctly.
The reason for the same is that in AIX we were not managing thread states. In particular we do not know
when a thread terminates.
The reason being in sync_threadlists () the pbuf and gbuf lists remain the same though certain threads exit.
This patch is a fix to the same.
Also certain UI is changed.
On a new thread born and exit the UI in AIX will be similar to Linux with both user and kernel thread information.
[New Thread 258 (tid 32178533)]
[New Thread 515 (tid 30343651)]
[New Thread 772 (tid 33554909)]
[New Thread 1029 (tid 24969489)]
[New Thread 1286 (tid 18153945)]
[New Thread 1543 (tid 30736739)]
[Thread 258 (tid 32178533) exited]
[Thread 515 (tid 30343651) exited]
[Thread 772 (tid 33554909) exited]
[Thread 1029 (tid 24969489) exited]
[Thread 1286 (tid 18153945) exited]
[Thread 1543 (tid 30736739) exited]
and info threads will look like
(gdb) info threads
Id Target Id Frame
* 1 Thread 1 (tid 31326579) ([running]) 0xd0611d70 in _p_nsleep () from /usr/lib/libpthread.a(_shr_xpg5.o)
Also a small change to testcase gdb.threads/thread_events.exp to make sure this test runs on AIX as well.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.threads/thread_events.exp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.threads/thread_events.exp b/gdb/testsuite/gdb.threads/thread_events.exp index 100205e..ca51abe 100644 --- a/gdb/testsuite/gdb.threads/thread_events.exp +++ b/gdb/testsuite/gdb.threads/thread_events.exp @@ -21,11 +21,9 @@ # messages are printed and can be disabled) is dependent on the target # thread support code. -# This test has only been verified with Linux targets, and would need +# This test has been verified with Linux targets and AIX target, and would need # to be generalized to support other targets -if {![istarget *-*-linux*]} { - return -} +require {is_any_target "*-*-linux*" "*-*-aix*"} # When using the RSP, we don't get notifications about new threads. # This is expected, so don't test for that. |