This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

private_thread_info thread-db.c and lin-lwp.c


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.

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

	Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]