[PATCH] Fix-for-multiple-thread-detection-in-AIX.patch

Ulrich Weigand Ulrich.Weigand@de.ibm.com
Mon Jul 25 12:21:33 GMT 2022


Aditya Kamath1 <Aditya.Kamath1@ibm.com> wrote:

>The cause of the bug :- Since, for the GDB core we are
>switch_to_no_thread() i.e. we do not have a thread till we return the
>pid from the wait() there is no thread. So, when a call is made from
>pd_activate() in wait() of aix-thread.c, to pthdb_session_init() we are
>going to recieve PTHDB_NOT_THREADED.

Thanks for the explanation.  I wasn't aware the use of
inferior_ptid happens in some of callback routines used
by the pthdb_session_init() library routine.

I still think the proposed fix isn't really ideal.  Can you instead
try to *temporarily* (i.e. using a scoped_restore) set up inferior_ptid
in pd_activate() before calling pthdb_session_init(), with a comment
explaining that this is needed for the callbacks?

[ pd_activate currently gets a pid.  If this isn't sufficient to set
up inferior_ptid, you might have to change the pd_activate interface
again to take a full ptid. ]


Bye,
Ulrich



More information about the Gdb-patches mailing list