GDBserver
|
#include "server.h"
#include "linux-low.h"
#include "gdb_proc_service.h"
#include "gdb_thread_db.h"
#include "gdb_vecs.h"
#include <dlfcn.h>
#include <stdint.h>
#include <limits.h>
#include <ctype.h>
Go to the source code of this file.
do \ { \ if ((a) == NULL) \ { \ if (debug_threads) \ fprintf (stderr, "dlsym: %s\n", dlerror ()); \ if (required) \ { \ free (tdb); \ proc->private->thread_db = NULL; \ return 0; \ } \ } \ } \ while (0)
Referenced by try_thread_db_load_1().
static int any_thread_of | ( | struct inferior_list_entry * | entry, |
void * | args | ||
) | [static] |
Definition at line 830 of file thread-db.c.
References inferior_list_entry::id, and ptid_get_pid().
Referenced by switch_to_process().
static int attach_thread | ( | const td_thrhandle_t * | th_p, |
td_thrinfo_t * | ti_p | ||
) | [static] |
Definition at line 324 of file thread-db.c.
References current_process(), debug_threads, error(), find_lwp_pid(), linux_attach_lwp(), pid_to_ptid(), process_info::private, TD_OK, thread_db::td_thr_event_enable_p, process_info_private::thread_db, thread_db_err_str(), thread_db_use_events, td_thrinfo::ti_lid, td_thrinfo::ti_tid, and warning().
Referenced by maybe_attach_thread().
static void disable_thread_event_reporting | ( | struct process_info * | proc | ) | [static] |
Definition at line 853 of file thread-db.c.
References current_inferior, thread_db::handle, process_info::private, switch_to_process(), td_event_fillset, td_ta_clear_event(), thread_db::thread_agent, and process_info_private::thread_db.
Referenced by thread_db_detach().
static int find_new_threads_callback | ( | const td_thrhandle_t * | th_p, |
void * | data | ||
) | [static] |
Definition at line 381 of file thread-db.c.
References current_process(), error(), maybe_attach_thread(), process_info::private, TD_OK, thread_db::td_thr_get_info_p, TD_THR_UNKNOWN, TD_THR_ZOMBIE, process_info_private::thread_db, thread_db_err_str(), and td_thrinfo::ti_state.
Referenced by thread_db_create_event(), and thread_db_find_new_threads().
static int find_one_thread | ( | ptid_t | ptid | ) | [static] |
Definition at line 265 of file thread-db.c.
References all_threads, current_process(), debug_threads, error(), find_inferior_id(), get_thread_lwp, process_info::private, ptid_get_lwp(), TD_OK, thread_db::td_ta_map_lwp2thr_p, thread_db::td_thr_event_enable_p, thread_db::td_thr_get_info_p, thread_db::thread_agent, process_info_private::thread_db, thread_db_err_str(), thread_db_use_events, td_thrinfo::ti_lid, td_thrinfo::ti_tid, and warning().
Referenced by thread_db_create_event(), thread_db_find_new_threads(), and thread_db_get_tls_address().
static int maybe_attach_thread | ( | const td_thrhandle_t * | th_p, |
td_thrinfo_t * | ti_p, | ||
int * | counter | ||
) | [static] |
Definition at line 362 of file thread-db.c.
References attach_thread(), find_lwp_pid(), pid_to_ptid(), and td_thrinfo::ti_lid.
Referenced by find_new_threads_callback().
static void remove_thread_event_breakpoints | ( | struct process_info * | proc | ) | [static] |
Definition at line 885 of file thread-db.c.
References current_inferior, delete_breakpoint(), process_info::private, switch_to_process(), thread_db::td_create_bp, and process_info_private::thread_db.
Referenced by thread_db_detach().
static void switch_to_process | ( | struct process_info * | proc | ) | [static] |
Definition at line 841 of file thread-db.c.
References all_threads, any_thread_of(), current_inferior, find_inferior(), and pid_of.
Referenced by disable_thread_event_reporting(), and remove_thread_event_breakpoints().
static int thread_db_create_event | ( | CORE_ADDR | where | ) | [static] |
Definition at line 186 of file thread-db.c.
References current_inferior, current_process(), debug_threads, fatal(), find_new_threads_callback(), find_one_thread(), get_thread_lwp, lwp_info::head, inferior_list_entry::id, process_info::private, TD_OK, thread_db::td_ta_event_getmsg_p, td_event_msg::th_p, thread_db::thread_agent, process_info_private::thread_db, and thread_db_err_str().
Referenced by thread_db_enable_reporting().
void thread_db_detach | ( | struct process_info * | proc | ) |
Definition at line 903 of file thread-db.c.
References disable_thread_event_reporting(), process_info::private, remove_thread_event_breakpoints(), and process_info_private::thread_db.
Referenced by linux_detach().
static int thread_db_enable_reporting | ( | void | ) | [static] |
Definition at line 223 of file thread-db.c.
References td_notify::bptaddr, current_process(), process_info::private, set_breakpoint_at(), TD_CREATE, thread_db::td_create_bp, td_event_addset, td_event_emptyset, TD_OK, thread_db::td_ta_event_addr_p, thread_db::td_ta_event_getmsg_p, thread_db::td_ta_set_event_p, thread_db::thread_agent, process_info_private::thread_db, thread_db_create_event(), thread_db_err_str(), td_notify::u, and warning().
Referenced by thread_db_init().
static const char* thread_db_err_str | ( | td_err_e | err | ) | [static] |
Definition at line 100 of file thread-db.c.
References TD_BADKEY, TD_BADPH, TD_BADSH, TD_BADTA, TD_BADTH, TD_DBERR, TD_ERR, TD_MALLOC, TD_NOAPLIC, TD_NOCAPAB, TD_NOEVENT, TD_NOFPREGS, TD_NOLIBTHREAD, TD_NOLWP, TD_NOMSG, TD_NOSV, TD_NOTHR, TD_NOTSD, TD_NOXREGS, TD_OK, TD_PARTIALREG, TD_VERSION, and xsnprintf().
Referenced by attach_thread(), find_new_threads_callback(), find_one_thread(), thread_db_create_event(), thread_db_enable_reporting(), thread_db_find_new_threads(), and try_thread_db_load_1().
static void thread_db_find_new_threads | ( | void | ) | [static] |
Definition at line 406 of file thread-db.c.
References current_process(), current_ptid, debug_threads, error(), find_new_threads_callback(), find_one_thread(), process_info::private, TD_OK, TD_SIGNO_MASK, thread_db::td_ta_thr_iter_p, TD_THR_ANY_STATE, TD_THR_ANY_USER_FLAGS, TD_THR_LOWEST_PRIORITY, thread_db::thread_agent, process_info_private::thread_db, and thread_db_err_str().
Referenced by thread_db_init().
int thread_db_get_tls_address | ( | struct thread_info * | thread, |
CORE_ADDR | offset, | ||
CORE_ADDR | load_module, | ||
CORE_ADDR * | address | ||
) |
Definition at line 483 of file thread-db.c.
References thread_db::all_symbols_looked_up, current_inferior, find_one_thread(), get_thread_lwp, get_thread_process(), lwp_info::head, inferior_list_entry::id, process_info::private, TD_ERR, TD_NOTHR, TD_OK, thread_db::td_thr_tls_get_addr_p, and process_info_private::thread_db.
int thread_db_handle_monitor_command | ( | char * | mon | ) |
Definition at line 946 of file thread-db.c.
References libthread_db_search_path, monitor_output(), and xstrdup().
int thread_db_init | ( | int | use_events | ) |
Definition at line 796 of file thread-db.c.
References current_process(), thread_db_enable_reporting(), thread_db_find_new_threads(), thread_db_load_search(), thread_db_look_up_symbols(), thread_db_mourn(), and thread_db_use_events.
Referenced by linux_look_up_symbols().
static int thread_db_load_search | ( | void | ) | [static] |
Definition at line 743 of file thread-db.c.
References debug_threads, free_char_ptr_vec(), libthread_db_search_path, try_thread_db_load_from_dir(), try_thread_db_load_from_sdir(), VEC, VEC_iterate, and xstrdup().
Referenced by thread_db_init().
int thread_db_look_up_one_symbol | ( | const char * | name, |
CORE_ADDR * | addrp | ||
) |
Definition at line 469 of file thread-db.c.
References thread_db::all_symbols_looked_up, current_process(), look_up_one_symbol(), process_info::private, and process_info_private::thread_db.
Referenced by ps_pglobal_lookup().
static void thread_db_look_up_symbols | ( | void | ) | [static] |
Definition at line 454 of file thread-db.c.
References thread_db::all_symbols_looked_up, current_process(), look_up_one_symbol(), process_info::private, thread_db::td_symbol_list_p, and process_info_private::thread_db.
Referenced by thread_db_init().
void thread_db_mourn | ( | struct process_info * | proc | ) |
Definition at line 917 of file thread-db.c.
References thread_db::handle, process_info::private, td_ta_delete(), thread_db::thread_agent, and process_info_private::thread_db.
Referenced by linux_mourn(), and thread_db_init().
static int try_thread_db_load | ( | const char * | library | ) | [static] |
Definition at line 661 of file thread-db.c.
References debug_threads, strchr(), td_init(), and try_thread_db_load_1().
Referenced by try_thread_db_load_from_dir(), and try_thread_db_load_from_sdir().
static int try_thread_db_load_1 | ( | void * | handle | ) | [static] |
Definition at line 575 of file thread-db.c.
References CHK, current_process(), debug_threads, fatal(), thread_db::handle, process_info::private, thread_db::proc_handle, TD_OK, thread_db::td_symbol_list_p, thread_db::td_ta_event_addr_p, thread_db::td_ta_event_getmsg_p, thread_db::td_ta_map_lwp2thr_p, thread_db::td_ta_new_p, thread_db::td_ta_set_event_p, thread_db::td_ta_thr_iter_p, thread_db::td_thr_event_enable_p, thread_db::td_thr_get_info_p, thread_db::td_thr_tls_get_addr_p, thread_db::thread_agent, process_info_private::thread_db, thread_db_err_str(), thread_db_use_events, and xcalloc().
Referenced by try_thread_db_load().
static int try_thread_db_load_from_dir | ( | const char * | dir, |
size_t | dir_len | ||
) | [static] |
Definition at line 716 of file thread-db.c.
References _, memcpy(), try_thread_db_load(), warning(), and xmalloc().
Referenced by thread_db_load_search().
static int try_thread_db_load_from_sdir | ( | void | ) | [static] |
Definition at line 707 of file thread-db.c.
References try_thread_db_load().
Referenced by thread_db_load_search().
int debug_threads |
char* libthread_db_search_path [static] |
Definition at line 94 of file thread-db.c.
Referenced by thread_db_handle_monitor_command(), and thread_db_load_search().
int thread_db_use_events [static] |
Definition at line 27 of file thread-db.c.
Referenced by attach_thread(), find_one_thread(), thread_db_init(), and try_thread_db_load_1().