gdb_thread_db.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /* Copyright (C) 2000-2022 Free Software Foundation, Inc.
  2. This file is part of GDB.
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. #ifndef NAT_GDB_THREAD_DB_H
  14. #define NAT_GDB_THREAD_DB_H
  15. #ifdef HAVE_THREAD_DB_H
  16. #include <thread_db.h>
  17. #else
  18. #include "glibc_thread_db.h"
  19. #endif
  20. #ifndef LIBTHREAD_DB_SO
  21. #define LIBTHREAD_DB_SO "libthread_db.so.1"
  22. #endif
  23. #ifndef LIBTHREAD_DB_SEARCH_PATH
  24. /* $sdir appears before $pdir for some minimal security protection:
  25. we trust the system libthread_db.so a bit more than some random
  26. libthread_db associated with whatever libpthread the app is using. */
  27. #define LIBTHREAD_DB_SEARCH_PATH "$sdir:$pdir"
  28. #endif
  29. /* Types of the libthread_db functions. */
  30. typedef td_err_e (td_init_ftype) (void);
  31. typedef td_err_e (td_ta_new_ftype) (struct ps_prochandle * ps,
  32. td_thragent_t **ta);
  33. typedef td_err_e (td_ta_delete_ftype) (td_thragent_t *ta_p);
  34. typedef td_err_e (td_ta_map_lwp2thr_ftype) (const td_thragent_t *ta,
  35. lwpid_t lwpid, td_thrhandle_t *th);
  36. typedef td_err_e (td_ta_thr_iter_ftype) (const td_thragent_t *ta,
  37. td_thr_iter_f *callback, void *cbdata_p,
  38. td_thr_state_e state, int ti_pri,
  39. sigset_t *ti_sigmask_p,
  40. unsigned int ti_user_flags);
  41. typedef td_err_e (td_ta_event_addr_ftype) (const td_thragent_t *ta,
  42. td_event_e event, td_notify_t *ptr);
  43. typedef td_err_e (td_ta_set_event_ftype) (const td_thragent_t *ta,
  44. td_thr_events_t *event);
  45. typedef td_err_e (td_ta_clear_event_ftype) (const td_thragent_t *ta,
  46. td_thr_events_t *event);
  47. typedef td_err_e (td_ta_event_getmsg_ftype) (const td_thragent_t *ta,
  48. td_event_msg_t *msg);
  49. typedef td_err_e (td_thr_get_info_ftype) (const td_thrhandle_t *th,
  50. td_thrinfo_t *infop);
  51. typedef td_err_e (td_thr_event_enable_ftype) (const td_thrhandle_t *th,
  52. int event);
  53. typedef td_err_e (td_thr_tls_get_addr_ftype) (const td_thrhandle_t *th,
  54. psaddr_t map_address,
  55. size_t offset, psaddr_t *address);
  56. typedef td_err_e (td_thr_tlsbase_ftype) (const td_thrhandle_t *th,
  57. unsigned long int modid,
  58. psaddr_t *base);
  59. typedef const char ** (td_symbol_list_ftype) (void);
  60. typedef td_err_e (td_ta_delete_ftype) (td_thragent_t *);
  61. #endif /* NAT_GDB_THREAD_DB_H */