td_ta_event_addr.c 1.6 KB

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