td_ta_event_addr.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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, see
  15. <http://www.gnu.org/licenses/>. */
  16. #include "thread_dbP.h"
  17. td_err_e
  18. td_ta_event_addr (const td_thragent_t *ta_arg,
  19. td_event_e event, td_notify_t *addr)
  20. {
  21. td_thragent_t *const ta = (td_thragent_t *) ta_arg;
  22. td_err_e err;
  23. psaddr_t taddr = NULL;
  24. LOG ("td_ta_event_addr");
  25. /* Test whether the TA parameter is ok. */
  26. if (! ta_ok (ta))
  27. return TD_BADTA;
  28. switch (event)
  29. {
  30. case TD_CREATE:
  31. err = DB_GET_SYMBOL (taddr, ta, __nptl_create_event);
  32. break;
  33. case TD_DEATH:
  34. err = DB_GET_SYMBOL (taddr, ta, __nptl_death_event);
  35. break;
  36. default:
  37. /* Event cannot be handled. */
  38. return TD_NOEVENT;
  39. }
  40. if (err == TD_OK)
  41. {
  42. /* Success, we got the address. */
  43. addr->type = NOTIFY_BPT;
  44. addr->u.bptaddr = taddr;
  45. }
  46. return err;
  47. }