GDB (xrefs)
|
#include "defs.h"
#include <dlfcn.h>
#include "gdb_proc_service.h"
#include "nat/gdb_thread_db.h"
#include "gdb_vecs.h"
#include "bfd.h"
#include "command.h"
#include "gdbcmd.h"
#include "gdbthread.h"
#include "inferior.h"
#include "infrun.h"
#include "symfile.h"
#include "objfiles.h"
#include "target.h"
#include "regcache.h"
#include "solib.h"
#include "solib-svr4.h"
#include "gdbcore.h"
#include "observer.h"
#include "linux-nat.h"
#include "nat/linux-procfs.h"
#include "nat/linux-ptrace.h"
#include "nat/linux-osdata.h"
#include "auto-load.h"
#include "cli/cli-utils.h"
#include <signal.h>
#include <ctype.h>
#include "nat/linux-namespaces.h"
Go to the source code of this file.
Classes | |
struct | thread_db_info |
struct | private_thread_info |
struct | callback_data |
Variables | |
static char * | libthread_db_search_path |
static int | auto_load_thread_db = 1 |
static unsigned int | libthread_db_debug |
static struct target_ops | thread_db_ops |
static int | thread_signals |
static sigset_t | thread_stop_set |
static sigset_t | thread_print_set |
struct thread_db_info * | thread_db_list |
initialize_file_ftype | _initialize_thread_db |
void _initialize_thread_db | ( | void | ) |
Definition at line 2142 of file linux-thread-db.c.
References _, add_cmd(), add_setshow_boolean_cmd(), add_setshow_optional_filename_cmd(), add_setshow_zuinteger_cmd(), auto_load_info_cmdlist_get(), auto_load_set_cmdlist_get(), auto_load_show_cmdlist_get(), auto_load_thread_db, class_info, class_maintenance, class_support, info_auto_load_libthread_db(), init_thread_db_ops(), libthread_db_debug, LIBTHREAD_DB_SEARCH_PATH, libthread_db_search_path, observer_attach_inferior_created(), observer_attach_new_objfile(), set_libthread_db_search_path(), setdebuglist, setlist, show_auto_load_thread_db(), show_libthread_db_debug(), showdebuglist, showlist, thread_db_inferior_created(), and thread_db_new_objfile().
|
static |
Definition at line 230 of file linux-thread-db.c.
References thread_db_info::handle, inferior_ptid, thread_db_info::need_stale_parent_threads_check, thread_db_info::next, thread_db_info::pid, ptid_get_pid(), target_has_execution, thread_db_list, and xcalloc().
Referenced by try_thread_db_load().
|
static |
Definition at line 1238 of file linux-thread-db.c.
References delete_thread(), private_thread_info::dying, find_thread_ptid(), get_thread_db_info(), lin_lwp_attach_lwp(), thread_info::priv, ptid_build(), ptid_get_pid(), record_thread(), target_has_execution, and td_thrinfo::ti_lid.
Referenced by check_event(), and find_new_threads_callback().
|
static |
Definition at line 1410 of file linux-thread-db.c.
References _, attach_thread(), detach_thread(), err, error(), td_event_msg::event, gdbarch_decr_pc_after_break(), get_regcache_arch(), get_thread_db_info(), get_thread_regcache(), have_threads(), in_thread_list(), thread_db_info::proc_handle, ps_prochandle::ptid, ptid_build(), ptid_get_pid(), regcache_read_pc(), stop_pc, target_supports_stopped_by_sw_breakpoint, TD_CREATE, thread_db_info::td_create_bp_addr, TD_DEATH, thread_db_info::td_death_bp_addr, TD_NOMSG, TD_OK, thread_db_info::td_ta_event_getmsg_p, thread_db_info::td_thr_get_info_p, td_event_msg::th_p, thread_db_info::thread_agent, thread_db_err_str(), thread_db_find_new_threads_1(), and td_thrinfo::ti_lid.
Referenced by thread_db_wait().
void check_for_thread_db | ( | void | ) |
Definition at line 1157 of file linux-thread-db.c.
References thread_db_load().
Referenced by linux_child_follow_fork(), thread_db_inferior_created(), and thread_db_new_objfile().
|
static |
Definition at line 1193 of file linux-thread-db.c.
References _, current_target, inferior_ptid, LINUX_NS_PID, linux_ns_same(), ptid_get_pid(), target_can_run, and warning().
Referenced by thread_db_inferior_created().
|
static |
Definition at line 1127 of file linux-thread-db.c.
References gdb_signal_from_host(), lin_thread_get_thread_signals(), signal_print_update(), signal_stop_update(), thread_print_set, thread_signals, and thread_stop_set.
Referenced by record_thread().
|
static |
Definition at line 270 of file linux-thread-db.c.
References thread_db_info::next, and xfree().
Referenced by thread_db_detach(), thread_db_mourn_inferior(), thread_db_wait(), and try_thread_db_load().
|
static |
Definition at line 1353 of file linux-thread-db.c.
References private_thread_info::dying, find_thread_ptid(), gdb_assert, and thread_info::priv.
Referenced by check_event().
|
static |
Definition at line 1110 of file linux-thread-db.c.
References thread_db_info::td_create_bp_addr, thread_db_info::td_death_bp_addr, td_event_fillset, thread_db_info::td_ta_clear_event_p, and thread_db_info::thread_agent.
Referenced by thread_db_detach().
Definition at line 657 of file linux-thread-db.c.
Referenced by try_thread_db_load(), and try_thread_db_load_1().
Definition at line 479 of file linux-thread-db.c.
References td_notify::bptaddr, create_thread_event_breakpoint(), current_target, err, exec_bfd, gdb_assert, gdbarch_convert_from_func_ptr_addr(), get_thread_db_info(), inferior_ptid, notify, thread_db_info::proc_handle, ps_prochandle::ptid, ptid_get_pid(), target_gdbarch(), TD_OK, thread_db_info::td_ta_event_addr_p, thread_db_info::thread_agent, and td_notify::u.
Referenced by enable_thread_event_reporting().
|
static |
Definition at line 541 of file linux-thread-db.c.
References _, enable_thread_event(), err, get_thread_db_info(), inferior_has_bug(), inferior_ptid, ptid_get_pid(), remove_thread_event_breakpoints(), TD_CREATE, thread_db_info::td_create_bp_addr, TD_DEATH, thread_db_info::td_death_bp_addr, td_event_addset, td_event_emptyset, TD_OK, thread_db_info::td_ta_event_addr_p, thread_db_info::td_ta_event_getmsg_p, thread_db_info::td_ta_set_event_p, thread_db_info::td_thr_event_enable_p, thread_db_info::thread_agent, thread_db_err_str(), and warning().
Referenced by try_thread_db_load_1().
|
static |
Definition at line 1573 of file linux-thread-db.c.
References _, attach_thread(), err, error(), find_thread_ptid(), fprintf_unfiltered(), gdb_stdlog, callback_data::info, libthread_db_debug, linux_proc_get_tgid(), thread_db_info::need_stale_parent_threads_check, callback_data::new_threads, thread_db_info::pid, thread_info::priv, ptid_build(), target_has_execution, TD_OK, thread_db_info::td_thr_event_enable_p, thread_db_info::td_thr_get_info_p, thread_db_err_str(), thread_db_use_events(), td_thrinfo::ti_lid, td_thrinfo::ti_tid, and update_thread_state().
Referenced by find_new_threads_once().
|
static |
Definition at line 1665 of file linux-thread-db.c.
References _, CATCH, END_CATCH, err, exception_fprintf(), find_new_threads_callback(), fprintf_unfiltered(), gdb_assert, gdb_stdlog, callback_data::info, libthread_db_debug, callback_data::new_threads, RETURN_MASK_ERROR, target_has_execution, TD_ERR, TD_SIGNO_MASK, thread_db_info::td_ta_thr_iter_p, TD_THR_ANY_STATE, TD_THR_ANY_USER_FLAGS, TD_THR_LOWEST_PRIORITY, thread_db_info::thread_agent, thread_db_use_events(), and TRY.
Referenced by thread_db_find_new_threads_2().
|
static |
Definition at line 253 of file linux-thread-db.c.
References thread_db_info::next, and thread_db_info::pid.
Referenced by attach_thread(), check_event(), enable_thread_event(), enable_thread_event_reporting(), thread_db_detach(), thread_db_find_new_threads_2(), thread_db_get_thread_local_address(), thread_db_load(), thread_db_notice_clone(), thread_db_resume(), thread_db_update_thread_list_td_ta_thr_iter(), thread_db_wait(), and thread_from_lwp().
|
static |
Definition at line 1058 of file linux-thread-db.c.
References ALL_OBJFILES, libpthread_name_p(), and objfile_name().
Referenced by thread_db_load().
Definition at line 398 of file linux-thread-db.c.
References have_threads_callback(), iterate_over_threads(), pid, and ptid_get_pid().
Referenced by check_event(), and thread_db_get_thread_local_address().
|
static |
Definition at line 387 of file linux-thread-db.c.
References pid, thread_info::priv, thread_info::ptid, and ptid_get_pid().
Referenced by have_threads().
|
static |
Definition at line 514 of file linux-thread-db.c.
References BMSYMBOL_VALUE_ADDRESS, err, lookup_minimal_symbol(), bound_minimal_symbol::minsym, target_read_string(), version, and xfree().
Referenced by enable_thread_event_reporting(), and thread_db_find_new_threads_silently().
|
static |
Definition at line 1993 of file linux-thread-db.c.
References _, auto_load_info_scripts_pattern_nl, current_uiout, do_cleanups(), error(), thread_db_info::filename, gdb_assert, info_auto_load_libthread_db_compare(), make_cleanup(), make_cleanup_ui_out_table_begin_end(), make_cleanup_ui_out_tuple_begin_end(), max, thread_db_info::next, thread_db_info::pid, pid, pids, qsort, skip_spaces_const(), ui_left, ui_out_field_string(), ui_out_message(), ui_out_table_body(), ui_out_table_header(), ui_out_text(), xfree(), xmalloc(), and xsnprintf().
Referenced by _initialize_thread_db().
Definition at line 1977 of file linux-thread-db.c.
References thread_db_info::filename, and thread_db_info::pid.
Referenced by info_auto_load_libthread_db().
|
static |
Definition at line 2116 of file linux-thread-db.c.
References complete_target_initialization(), OPS_MAGIC, tc_schedlock, thread_db_detach(), thread_db_extra_thread_info(), thread_db_get_ada_task_ptid(), thread_db_get_thread_local_address(), thread_db_mourn_inferior(), thread_db_ops, thread_db_pid_to_str(), thread_db_resume(), thread_db_update_thread_list(), thread_db_wait(), thread_stratum, target_ops::to_detach, target_ops::to_doc, target_ops::to_extra_thread_info, target_ops::to_get_ada_task_ptid, target_ops::to_get_thread_local_address, target_ops::to_has_thread_control, target_ops::to_longname, target_ops::to_magic, target_ops::to_mourn_inferior, target_ops::to_pid_to_str, target_ops::to_resume, target_ops::to_shortname, target_ops::to_stratum, target_ops::to_update_thread_list, and target_ops::to_wait.
Referenced by _initialize_thread_db().
|
static |
Definition at line 1307 of file linux-thread-db.c.
References _, add_thread_with_info(), check_thread_signals(), err, error(), new_thread(), thread_info::priv, thread_info::state, target_has_execution, target_pid_to_str(), TD_OK, thread_db_info::td_thr_event_enable_p, private_thread_info::th, thread_db_err_str(), thread_db_use_events(), THREAD_EXITED, td_thrinfo::ti_tid, private_thread_info::tid, update_thread_state(), and xmalloc().
Referenced by attach_thread(), and thread_from_lwp().
|
static |
Definition at line 103 of file linux-thread-db.c.
References LIBTHREAD_DB_SEARCH_PATH, libthread_db_search_path, and xfree().
Referenced by _initialize_thread_db().
|
static |
Definition at line 94 of file linux-thread-db.c.
References _, and fprintf_filtered().
Referenced by _initialize_thread_db().
|
static |
Definition at line 118 of file linux-thread-db.c.
References _, and fprintf_filtered().
Referenced by _initialize_thread_db().
|
static |
Definition at line 1371 of file linux-thread-db.c.
References delete_thread_db_info(), disable_thread_event_reporting(), find_target_beneath(), get_thread_db_info(), inferior_ptid, ptid_get_pid(), remove_thread_event_breakpoints(), target_has_execution, thread_db_ops, thread_db_use_events(), target_ops::to_detach, and unpush_target().
Referenced by init_thread_db_ops().
|
static |
Definition at line 317 of file linux-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_NOTALLOC, TD_NOTHR, TD_NOTLS, TD_NOTSD, TD_NOXREGS, TD_OK, TD_PARTIALREG, and TD_VERSION.
Referenced by check_event(), enable_thread_event_reporting(), find_new_threads_callback(), record_thread(), thread_db_find_new_threads_2(), thread_db_get_thread_local_address(), thread_from_lwp(), and try_thread_db_load_1().
|
static |
Definition at line 1842 of file linux-thread-db.c.
References private_thread_info::dying, and thread_info::priv.
Referenced by init_thread_db_ops().
|
static |
Definition at line 1748 of file linux-thread-db.c.
References thread_db_find_new_threads_2().
Referenced by check_event(), thread_db_get_thread_local_address(), and thread_db_update_thread_list_td_ta_thr_iter().
Definition at line 1716 of file linux-thread-db.c.
References _, err, error(), find_new_threads_once(), get_thread_db_info(), thread_db_info::proc_handle, ps_prochandle::ptid, ptid_get_pid(), TD_OK, and thread_db_err_str().
Referenced by thread_db_find_new_threads_1(), and thread_db_find_new_threads_silently().
Definition at line 609 of file linux-thread-db.c.
References _, CATCH, END_CATCH, exception_fprintf(), gdb_stderr, gdb_stdlog, inferior_has_bug(), libthread_db_debug, RETURN_MASK_ERROR, target_has_execution, thread_db_find_new_threads_2(), and TRY.
Referenced by try_thread_db_load_1().
|
static |
Definition at line 1945 of file linux-thread-db.c.
References inferior_ptid, ptid_build(), and ptid_get_pid().
Referenced by init_thread_db_ops().
|
static |
Definition at line 1858 of file linux-thread-db.c.
References _, target_ops::beneath, err, exec_bfd, find_target_beneath(), find_thread_ptid(), gdb_assert, get_thread_db_info(), have_threads(), thread_info::priv, ptid_get_pid(), TD_NOTALLOC, TD_OK, thread_db_info::td_thr_tls_get_addr_p, thread_db_info::td_thr_tlsbase_p, private_thread_info::th, thread_db_err_str(), thread_db_find_new_threads_1(), throw_error(), TLS_GENERIC_ERROR, TLS_LOAD_MODULE_NOT_FOUND_ERROR, TLS_NO_LIBRARY_SUPPORT_ERROR, TLS_NOT_ALLOCATED_YET_ERROR, and target_ops::to_get_thread_local_address.
Referenced by init_thread_db_ops().
|
static |
Definition at line 1216 of file linux-thread-db.c.
References check_for_thread_db(), and check_pid_namespace_match().
Referenced by _initialize_thread_db().
|
static |
Definition at line 1073 of file linux-thread-db.c.
References _, core_bfd, current_target, get_thread_db_info(), has_libpthread(), inferior_ptid, ptid_get_pid(), target_can_run, target_has_registers, thread_db_load_search(), and warning().
Referenced by check_for_thread_db().
|
static |
Definition at line 994 of file linux-thread-db.c.
References _, do_cleanups(), fprintf_unfiltered(), gdb_stdlog, libthread_db_debug, libthread_db_search_path, make_cleanup(), make_cleanup_free_char_ptr_vec(), null_cleanup(), try_thread_db_load_from_dir(), try_thread_db_load_from_pdir(), try_thread_db_load_from_sdir(), VEC, VEC_iterate, xfree(), and xmalloc().
Referenced by thread_db_load().
|
static |
Definition at line 1549 of file linux-thread-db.c.
References delete_thread_db_info(), find_target_beneath(), inferior_ptid, ptid_get_pid(), remove_thread_event_breakpoints(), target_ops::to_mourn_inferior, and unpush_target().
Referenced by init_thread_db_ops().
|
static |
Definition at line 1167 of file linux-thread-db.c.
References check_for_thread_db(), objfile::flags, libpthread_name_p(), OBJF_MAINLINE, objfile_name(), and objfile::separate_debug_objfile_backlink.
Referenced by _initialize_thread_db().
Definition at line 448 of file linux-thread-db.c.
References err, get_thread_db_info(), ptid_get_pid(), and thread_from_lwp().
Referenced by linux_handle_extended_wait().
|
static |
Definition at line 1817 of file linux-thread-db.c.
References target_ops::beneath, find_target_beneath(), find_thread_ptid(), thread_info::priv, ptid_get_lwp(), private_thread_info::tid, and target_ops::to_pid_to_str.
Referenced by init_thread_db_ops().
|
static |
Definition at line 1952 of file linux-thread-db.c.
References target_ops::beneath, find_target_beneath(), get_thread_db_info(), inferior_ptid, minus_one_ptid, thread_db_info::need_stale_parent_threads_check, ptid_equal(), ptid_get_pid(), and target_ops::to_resume.
Referenced by init_thread_db_ops().
|
static |
Definition at line 1793 of file linux-thread-db.c.
References target_ops::beneath, iterate_over_lwps(), minus_one_ptid, target_has_execution, thread_db_update_thread_list_td_ta_thr_iter(), thread_db_use_events(), target_ops::to_update_thread_list, and update_thread_core().
Referenced by init_thread_db_ops().
|
static |
Definition at line 1763 of file linux-thread-db.c.
References ALL_INFERIORS, any_live_thread_of_process(), thread_info::executing, get_thread_db_info(), arm-linux::inf, inferior::pid, prune_threads(), thread_info::ptid, and thread_db_find_new_threads_1().
Referenced by thread_db_update_thread_list().
|
static |
Definition at line 85 of file linux-thread-db.c.
References linux_supports_traceclone().
Referenced by find_new_threads_callback(), find_new_threads_once(), record_thread(), thread_db_detach(), thread_db_update_thread_list(), and try_thread_db_load_1().
|
static |
Definition at line 1501 of file linux-thread-db.c.
References target_ops::beneath, check_event(), delete_thread_db_info(), find_target_beneath(), get_thread_db_info(), target_waitstatus::kind, ptid_get_pid(), target_waitstatus::sig, TARGET_WAITKIND_EXECD, TARGET_WAITKIND_EXITED, TARGET_WAITKIND_IGNORE, TARGET_WAITKIND_SIGNALLED, TARGET_WAITKIND_STOPPED, thread_db_ops, thread_from_lwp(), target_ops::to_wait, unpush_target(), and target_waitstatus::value.
Referenced by init_thread_db_ops().
|
static |
Definition at line 409 of file linux-thread-db.c.
References _, err, error(), find_thread_ptid(), gdb_assert, get_thread_db_info(), thread_db_info::proc_handle, thread_info::ptid, ps_prochandle::ptid, ptid_get_lwp(), ptid_get_pid(), record_thread(), TD_OK, thread_db_info::td_ta_map_lwp2thr_p, thread_db_info::td_thr_get_info_p, td_thrhandle::th_unique, thread_db_info::thread_agent, and thread_db_err_str().
Referenced by thread_db_notice_clone(), thread_db_wait(), and try_thread_db_load_1().
Definition at line 812 of file linux-thread-db.c.
References _, add_thread_db_info(), delete_thread_db_info(), dladdr_to_soname(), file_is_auto_load_safe(), thread_db_info::filename, fprintf_unfiltered(), gdb_realpath(), gdb_stdlog, inferior_ptid, libthread_db_debug, ptid_get_pid(), safe_strerror(), td_init(), and try_thread_db_load_1().
Referenced by try_thread_db_load_from_dir(), try_thread_db_load_from_pdir_1(), and try_thread_db_load_from_sdir().
|
static |
Definition at line 673 of file linux-thread-db.c.
References _, ALL_LWPS, dladdr_to_soname(), enable_thread_event_reporting(), err, fprintf_unfiltered(), gdb_stdlog, gdb_stdout, thread_db_info::handle, inferior_ptid, libthread_db_debug, libthread_db_search_path, LIBTHREAD_DB_SO, linux_proc_task_list_dir_exists(), linux_stop_and_wait_all_lwps(), linux_unstop_all_lwps(), thread_db_info::next, pid, printf_unfiltered(), thread_db_info::proc_handle, lwp_info::ptid, ps_prochandle::ptid, ptid_get_pid(), push_target(), target_has_execution, thread_db_info::td_init_p, TD_NOLIBTHREAD, TD_OK, thread_db_info::td_ta_clear_event_p, thread_db_info::td_ta_event_addr_p, thread_db_info::td_ta_event_getmsg_p, thread_db_info::td_ta_map_lwp2thr_p, thread_db_info::td_ta_new_p, thread_db_info::td_ta_set_event_p, thread_db_info::td_ta_thr_iter_p, thread_db_info::td_thr_event_enable_p, thread_db_info::td_thr_get_info_p, thread_db_info::td_thr_tls_get_addr_p, thread_db_info::td_thr_tlsbase_p, TD_VERSION, thread_db_info::thread_agent, thread_db_err_str(), thread_db_find_new_threads_silently(), thread_db_ops, thread_db_use_events(), thread_from_lwp(), verbose_dlsym(), and warning().
Referenced by try_thread_db_load().
Definition at line 967 of file linux-thread-db.c.
References auto_load_thread_db, do_cleanups(), LIBTHREAD_DB_SO, make_cleanup(), try_thread_db_load(), xfree(), and xmalloc().
Referenced by thread_db_load_search().
Definition at line 926 of file linux-thread-db.c.
References ALL_OBJFILES, auto_load_thread_db, libpthread_name_p(), objfile_name(), objfile::separate_debug_objfile_backlink, and try_thread_db_load_from_pdir_1().
Referenced by thread_db_load_search().
Definition at line 884 of file linux-thread-db.c.
References _, do_cleanups(), gdb_assert, LIBTHREAD_DB_SO, make_cleanup(), objfile_name(), try_thread_db_load(), warning(), xfree(), and xmalloc().
Referenced by try_thread_db_load_from_pdir().
|
static |
Definition at line 958 of file linux-thread-db.c.
References LIBTHREAD_DB_SO, and try_thread_db_load().
Referenced by thread_db_load_search().
Definition at line 1754 of file linux-thread-db.c.
References lwp_info::core, linux_common_core_of_thread(), and lwp_info::ptid.
Referenced by thread_db_update_thread_list().
|
static |
Definition at line 1226 of file linux-thread-db.c.
References private_thread_info::dying, TD_THR_UNKNOWN, TD_THR_ZOMBIE, and td_thrinfo::ti_state.
Referenced by find_new_threads_callback(), and record_thread().
|
static |
Definition at line 469 of file linux-thread-db.c.
Referenced by try_thread_db_load_1().
initialize_file_ftype _initialize_thread_db |
|
static |
Definition at line 79 of file linux-thread-db.c.
Referenced by _initialize_thread_db(), try_thread_db_load_from_dir(), and try_thread_db_load_from_pdir().
|
static |
Definition at line 115 of file linux-thread-db.c.
Referenced by _initialize_thread_db(), find_new_threads_callback(), find_new_threads_once(), thread_db_find_new_threads_silently(), thread_db_load_search(), try_thread_db_load(), and try_thread_db_load_1().
|
static |
Definition at line 75 of file linux-thread-db.c.
Referenced by _initialize_thread_db(), set_libthread_db_search_path(), thread_db_load_search(), and try_thread_db_load_1().
struct thread_db_info* thread_db_list |
Definition at line 212 of file linux-thread-db.c.
Referenced by add_thread_db_info().
|
static |
Definition at line 128 of file linux-thread-db.c.
Referenced by init_thread_db_ops(), thread_db_detach(), thread_db_wait(), and try_thread_db_load_1().
|
static |
Definition at line 134 of file linux-thread-db.c.
Referenced by check_thread_signals().
|
static |
Definition at line 132 of file linux-thread-db.c.
Referenced by check_thread_signals().
|
static |
Definition at line 133 of file linux-thread-db.c.
Referenced by check_thread_signals().