Date: Thu, 30 Jun 2011 09:24:47 -0500 From: John Schumacher <schumjs@gmail.com> To: David Xu <davidxu@freebsd.org> Cc: freebsd-threads@freebsd.org Subject: Re: Using fbsd-threads.c versus thread-db.c (gdbserver) Message-ID: <BANLkTi=jmyLgFWn4o1ENE63BCutrGypXpA@mail.gmail.com> In-Reply-To: <4E0C1787.8030102@freebsd.org> References: <BANLkTik5e87v59kP6emD=D5H8JmghTcu4Q@mail.gmail.com> <4E0C1787.8030102@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for the clarification David. So for something like gdbserver, which cannot currently query threads, the functional equivalent of fbsd-threads must be implemented to allow for thread awareness? Would there be a reason that gdbserver cannot use the same functions as gdb is using to query threads (gdb being thread aware)? It seems like after the attach on the initial process, there should be no difference between the two- the only difference that I can see is that gdbserver can attach on-the-fly, so it would have to be aware of existing threads. I have looked at the linux flavour of gdbserver. It has full thread awareness and manipulation, but using the nptl threading methods which allow lwps to be handled as full processes. This essentially allows every request type of ptrace() to operate on lwps. There's more to it (like handling certain signals), but that seems to be the big difference. I guess another valid question would be if FreeBSD planned on implementing nptl-like threading in the near future... Thanks a bunch -John On Thu, Jun 30, 2011 at 1:28 AM, David Xu <davidxu@freebsd.org> wrote: > On 2011/06/30 01:36, John Schumacher wrote: > > Question: > > Does anyone understand the differences between freebsd-threads.c and > > thread-db.c in FreeBSD? > > Linux's gdbserver makes calls to thread-db.c and thread-db.c sits in the > > gdbserver folder in the 8.1 FreeBSD distro. > > However, I notice that fbsd-threads.c (which sits in > > FreeBSD\8.1\builds\8.1\kernel\source\gnu\usr.bin\gdb\libgdb) has similar > > functionality. > > Is the thread-db.c sitting in the gdbserver a relic from when it was > ported > > over, and doesn't work with FreeBSD? Should one use the fbsd-threads.c to > > query the kernel for new and existing threads? > > > AFAIK, thread-db.c is for Linux only, fbsd-threads.c is FreeBSD code > which implements gdb's target, the code depends on external library > called libthread_db which is a standard to query threads. > > > Thanks > > -John > > > -- John Schumacher University of Minnesota (TC) Electrical Engineering
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BANLkTi=jmyLgFWn4o1ENE63BCutrGypXpA>