Using fbsd-threads.c versus thread-db.c (gdbserver)

David Xu davidxu at
Thu Jun 30 06:28:23 UTC 2011

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

More information about the freebsd-threads mailing list