[commit/AIX] cannot resume after attaching to process

Joel Brobecker brobecker@adacore.com
Wed May 20 18:14:00 GMT 2009


Hello,

This is a patch that AdaCore has had in its internal tree for a little
while, now.  It fixes an issue on AIX where the user is unable to continue
after having attached to a problem that has threads.

The problem is that the thread debug library maintains a list of threads
which does not include the "main" thread.  As a result, when we try to
synchronize GDB's thread list with the list returned by the pthread
debug library, GDB thinks that the "main" thread has disappeared/died.
As such, it removes that thread from GDB's list of threads.  Later, when
we try to do a "continue", the inferior ptid is still set to that same
main thread.  That's when we detect that the thread is dead, and we
can't resume the execution of a thread that no longer exists...

The solution I chose was to tweak the iterators used to build GDB's list
of thread to exclude the main thread.  That thread is easy to identify,
as it's the only thread that has a null tid.  As a result, the main
thread is always excluded from the synchronization process, and stays
until the program exits.

2009-05-20  Joel Brobecker  <brobecker@adacore.com>

        * aix-thread.c (giter_count): Do not count the main thread.
        (giter_accum): Do not include the main thread.

Tested on powerpc-aix. Will commit shortly.

-- 
Joel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aix-threads.diff
Type: text/x-diff
Size: 1482 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20090520/2a1554f5/attachment.bin>


More information about the Gdb-patches mailing list