From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: Andrew Cagney Cc: gdb@sources.redhat.com Subject: Re: private_thread_info thread-db.c and lin-lwp.c Date: Wed, 25 Jul 2001 14:04:00 -0000 Message-id: References: <3B5E736C.9040702@cygnus.com> X-SW-Source: 2001-07/msg00362.html Andrew Cagney writes: > Hello, > > I was looking to make ``struct thread_info'' opaque again but, noticed this: > > thread-db.c contains: > struct private_thread_info > { > /* Cached LWP id. Must come first, see lin-lwp.c. */ > lwpid_t lwpid; > }; > .... > tp = add_thread (ptid); > tp->private = xmalloc (sizeof (struct private_thread_info)); > tp->private->lwpid = ti_p->ti_lid; > but no obvious reference to ->private. > > Meanwhile, lin-lwp.c contains: > struct private_thread_info > { > int lwpid; > }; > .... > if (tp->private->lwpid == GET_LWP (lp->ptid)) > but no obvious initialization of ->private when adding threads. Those bits were supposed to interact closely. Under normal circumstances the code in lin-lwp.c shouldn't be adding threads to GDB's list. > It turns out that the main thing keeping this working is that the > lin-lwp.c code is in an unreachable function (find_lwp_callback()). Well, that bit of code was used until recently. I put it in to work around bug in some of the GDB core code. Michael Snyder believes he's fixed that bug, and disabled the bit of code. Things seem to work right now, so I think we can rip this bit of code out. Mark