libthread_db thread handles

Ulrich Drepper drepper@redhat.com
Tue Jan 14 23:41:00 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Jacobowitz wrote:

> To find the state of a thread, we need to first get a thread handle for
> it and only then can we call td_thr_get_info.  I'd like to save a copy
> of the td_thrhandle_t when we get the TD_CREATE event,

The problem is calling the *_iter functions or so?

If you have the pthread_t value computing the td_thrhandle_t is an
operation which can be performed entirely without the looking at the
inferior.  At least in the new implementation.  Just call
td_ta_map_id2thr().  This shouldn't add any measurable overhead.

I would prefer you caching the pthread_t value very much over caching
any opaque data structure.  If this means adding a function
td_ta_map_thr2id() I'd have no problems with it.  But not even this
should be necessary since for both events, TD_CREATE and TD_DEATH, the
eventdata is the pthread_t value.  And this should be a documented
interface.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+JKAK2ijCOnn/RHQRAkQPAJ4nWwjfiDFhbpMjooxuUEiH5Dc4pwCfT9La
XkXgLoaakbUo5xoO9YXRj1k=
=hQUV
-----END PGP SIGNATURE-----



More information about the Gdb mailing list