td_ta_event_addr.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* Get event address.
  2. Copyright (C) 1999,2001,2002,2003 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. Contributed by Ulrich Drepper <drepper@redhat.com>, 1999.
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with the GNU C Library; if not, write to the Free
  15. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  16. 02111-1307 USA. */
  17. #include "thread_dbP.h"
  18. td_err_e
  19. td_ta_event_addr (const td_thragent_t *ta_arg,
  20. td_event_e event, td_notify_t *addr)
  21. {
  22. td_thragent_t *const ta = (td_thragent_t *) ta_arg;
  23. td_err_e err;
  24. psaddr_t taddr = NULL;
  25. LOG ("td_ta_event_addr");
  26. /* Test whether the TA parameter is ok. */
  27. if (! ta_ok (ta))
  28. return TD_BADTA;
  29. switch (event)
  30. {
  31. case TD_CREATE:
  32. err = DB_GET_SYMBOL (taddr, ta, __nptl_create_event);
  33. break;
  34. case TD_DEATH:
  35. err = DB_GET_SYMBOL (taddr, ta, __nptl_death_event);
  36. break;
  37. default:
  38. /* Event cannot be handled. */
  39. return TD_NOEVENT;
  40. }
  41. if (err == TD_OK)
  42. {
  43. /* Success, we got the address. */
  44. addr->type = NOTIFY_BPT;
  45. addr->u.bptaddr = taddr;
  46. }
  47. return err;
  48. }