Date: Fri, 25 Jul 2008 14:53:51 -0400 From: "Dixit, Amol" <dixit@netapp.com> To: freebsd-threads@freebsd.org Subject: libpthread and gdbserver Message-ID: <488A213F.70105@netapp.com>
next in thread | raw e-mail | index | archive | help
Hi, I am attempting to port gdbserver to freebsd (initially only for x86 & libpthread) and I need some assistance with libpthread and libthread-db. (i) From the code looks like libpthread does not provide any 'thread creation event' symbol/address to be looked up by thread-db. I got around this by adding a dummy function call before _thread_create returned, and that new symbol can be used by thread-db to set thread-creation breakpoint (analogous to _thread_bp_create in libthr). (ii) Next hurdle is the race between thread-db and libpthread. Thread-db tries to access '_thread_list' which is maintained in libpthread and will eventually contain the 'initial thread' but this list is NULL when thread-db tries to access it early. There is a comment before _pthread_create() "It'd be nice to automatically have _libpthread_init called on program execution..." which will be helpful for thread-db. Currently I am stuck here as thread-db cannot enable threading early enough since libpthread is assigning 'initial thread' to '_thread_list' lazily. Am I on the right track on above issues? Any work going on in this area? Really appreciate any help on this project. Thanks, Amol
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?488A213F.70105>