GDB (xrefs)
Classes | Functions | Variables
/tmp/gdb-7.10/gdb/linux-thread-db.c File Reference
#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
 

Functions

static int thread_db_use_events (void)
 
static void show_auto_load_thread_db (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void set_libthread_db_search_path (char *ignored, int from_tty, struct cmd_list_element *c)
 
static void show_libthread_db_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static void thread_db_find_new_threads_1 (ptid_t ptid)
 
static void thread_db_find_new_threads_2 (ptid_t ptid, int until_no_new)
 
static void check_thread_signals (void)
 
static void record_thread (struct thread_db_info *info, struct thread_info *tp, ptid_t ptid, const td_thrhandle_t *th_p, const td_thrinfo_t *ti_p)
 
static struct thread_db_infoadd_thread_db_info (void *handle)
 
static struct thread_db_infoget_thread_db_info (int pid)
 
static void delete_thread_db_info (int pid)
 
static int attach_thread (ptid_t ptid, const td_thrhandle_t *th_p, const td_thrinfo_t *ti_p)
 
static void detach_thread (ptid_t ptid)
 
static char * thread_db_err_str (td_err_e err)
 
static int have_threads_callback (struct thread_info *thread, void *args)
 
static int have_threads (ptid_t ptid)
 
static void thread_from_lwp (ptid_t ptid)
 
int thread_db_notice_clone (ptid_t parent, ptid_t child)
 
static void * verbose_dlsym (void *handle, const char *name)
 
static td_err_e enable_thread_event (int event, CORE_ADDR *bp)
 
static int inferior_has_bug (const char *ver_symbol, int ver_major_min, int ver_minor_min)
 
static void enable_thread_event_reporting (void)
 
static int thread_db_find_new_threads_silently (ptid_t ptid)
 
static const char * dladdr_to_soname (const void *addr)
 
static int try_thread_db_load_1 (struct thread_db_info *info)
 
static int try_thread_db_load (const char *library, int check_auto_load_safe)
 
static int try_thread_db_load_from_pdir_1 (struct objfile *obj, const char *subdir)
 
static int try_thread_db_load_from_pdir (const char *subdir)
 
static int try_thread_db_load_from_sdir (void)
 
static int try_thread_db_load_from_dir (const char *dir, size_t dir_len)
 
static int thread_db_load_search (void)
 
static int has_libpthread (void)
 
static int thread_db_load (void)
 
static void disable_thread_event_reporting (struct thread_db_info *info)
 
void check_for_thread_db (void)
 
static void thread_db_new_objfile (struct objfile *objfile)
 
static void check_pid_namespace_match (void)
 
static void thread_db_inferior_created (struct target_ops *target, int from_tty)
 
static void update_thread_state (struct private_thread_info *priv, const td_thrinfo_t *ti_p)
 
static void thread_db_detach (struct target_ops *ops, const char *args, int from_tty)
 
static void check_event (ptid_t ptid)
 
static ptid_t thread_db_wait (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *ourstatus, int options)
 
static void thread_db_mourn_inferior (struct target_ops *ops)
 
static int find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
 
static int find_new_threads_once (struct thread_db_info *info, int iteration, td_err_e *errp)
 
static int update_thread_core (struct lwp_info *info, void *closure)
 
static void thread_db_update_thread_list_td_ta_thr_iter (struct target_ops *ops)
 
static void thread_db_update_thread_list (struct target_ops *ops)
 
static char * thread_db_pid_to_str (struct target_ops *ops, ptid_t ptid)
 
static char * thread_db_extra_thread_info (struct target_ops *self, struct thread_info *info)
 
static CORE_ADDR thread_db_get_thread_local_address (struct target_ops *ops, ptid_t ptid, CORE_ADDR lm, CORE_ADDR offset)
 
static ptid_t thread_db_get_ada_task_ptid (struct target_ops *self, long lwp, long thread)
 
static void thread_db_resume (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal signo)
 
static int info_auto_load_libthread_db_compare (const void *ap, const void *bp)
 
static void info_auto_load_libthread_db (char *args, int from_tty)
 
static void init_thread_db_ops (void)
 
void _initialize_thread_db (void)
 

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_infothread_db_list
 
initialize_file_ftype _initialize_thread_db
 

Function Documentation

void _initialize_thread_db ( void  )
static struct thread_db_info* add_thread_db_info ( void *  handle)
static
static int attach_thread ( ptid_t  ptid,
const td_thrhandle_t th_p,
const td_thrinfo_t ti_p 
)
static
static void check_event ( ptid_t  ptid)
static
void check_for_thread_db ( void  )
static void check_pid_namespace_match ( void  )
static
static void check_thread_signals ( void  )
static
static void delete_thread_db_info ( int  pid)
static
static void detach_thread ( ptid_t  ptid)
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 void disable_thread_event_reporting ( struct thread_db_info info)
static
static const char* dladdr_to_soname ( const void *  addr)
static

Definition at line 657 of file linux-thread-db.c.

Referenced by try_thread_db_load(), and try_thread_db_load_1().

static td_err_e enable_thread_event ( int  event,
CORE_ADDR bp 
)
static
static void enable_thread_event_reporting ( void  )
static
static int find_new_threads_callback ( const td_thrhandle_t th_p,
void *  data 
)
static
static int find_new_threads_once ( struct thread_db_info info,
int  iteration,
td_err_e errp 
)
static
static struct thread_db_info* get_thread_db_info ( int  pid)
static
static int has_libpthread ( void  )
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().

static int have_threads ( ptid_t  ptid)
static
static int have_threads_callback ( struct thread_info thread,
void *  args 
)
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 int inferior_has_bug ( const char *  ver_symbol,
int  ver_major_min,
int  ver_minor_min 
)
static
static void info_auto_load_libthread_db ( char *  args,
int  from_tty 
)
static
static int info_auto_load_libthread_db_compare ( const void *  ap,
const void *  bp 
)
static

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 void init_thread_db_ops ( void  )
static
static void record_thread ( struct thread_db_info info,
struct thread_info tp,
ptid_t  ptid,
const td_thrhandle_t th_p,
const td_thrinfo_t ti_p 
)
static
static void set_libthread_db_search_path ( char *  ignored,
int  from_tty,
struct cmd_list_element c 
)
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 void show_auto_load_thread_db ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 94 of file linux-thread-db.c.

References _, and fprintf_filtered().

Referenced by _initialize_thread_db().

static void show_libthread_db_debug ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 118 of file linux-thread-db.c.

References _, and fprintf_filtered().

Referenced by _initialize_thread_db().

static void thread_db_detach ( struct target_ops ops,
const char *  args,
int  from_tty 
)
static
static char* thread_db_err_str ( td_err_e  err)
static
static char* thread_db_extra_thread_info ( struct target_ops self,
struct thread_info info 
)
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 void thread_db_find_new_threads_1 ( ptid_t  ptid)
static
static void thread_db_find_new_threads_2 ( ptid_t  ptid,
int  until_no_new 
)
static
static int thread_db_find_new_threads_silently ( ptid_t  ptid)
static
static ptid_t thread_db_get_ada_task_ptid ( struct target_ops self,
long  lwp,
long  thread 
)
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 CORE_ADDR thread_db_get_thread_local_address ( struct target_ops ops,
ptid_t  ptid,
CORE_ADDR  lm,
CORE_ADDR  offset 
)
static
static void thread_db_inferior_created ( struct target_ops target,
int  from_tty 
)
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 int thread_db_load ( void  )
static
static int thread_db_load_search ( void  )
static
static void thread_db_mourn_inferior ( struct target_ops ops)
static
static void thread_db_new_objfile ( struct objfile objfile)
static
int thread_db_notice_clone ( ptid_t  parent,
ptid_t  child 
)

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 char* thread_db_pid_to_str ( struct target_ops ops,
ptid_t  ptid 
)
static
static void thread_db_resume ( struct target_ops ops,
ptid_t  ptid,
int  step,
enum gdb_signal  signo 
)
static
static void thread_db_update_thread_list ( struct target_ops ops)
static
static void thread_db_update_thread_list_td_ta_thr_iter ( struct target_ops ops)
static
static int thread_db_use_events ( void  )
static
static ptid_t thread_db_wait ( struct target_ops ops,
ptid_t  ptid,
struct target_waitstatus ourstatus,
int  options 
)
static
static void thread_from_lwp ( ptid_t  ptid)
static
static int try_thread_db_load ( const char *  library,
int  check_auto_load_safe 
)
static
static int try_thread_db_load_1 ( struct thread_db_info info)
static
static int try_thread_db_load_from_dir ( const char *  dir,
size_t  dir_len 
)
static
static int try_thread_db_load_from_pdir ( const char *  subdir)
static
static int try_thread_db_load_from_pdir_1 ( struct objfile obj,
const char *  subdir 
)
static
static int try_thread_db_load_from_sdir ( void  )
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().

static int update_thread_core ( struct lwp_info info,
void *  closure 
)
static
static void update_thread_state ( struct private_thread_info priv,
const td_thrinfo_t ti_p 
)
static
static void* verbose_dlsym ( void *  handle,
const char *  name 
)
static

Definition at line 469 of file linux-thread-db.c.

References _, and warning().

Referenced by try_thread_db_load_1().

Variable Documentation

initialize_file_ftype _initialize_thread_db
int auto_load_thread_db = 1
static
unsigned int libthread_db_debug
static
char* libthread_db_search_path
static
struct thread_db_info* thread_db_list

Definition at line 212 of file linux-thread-db.c.

Referenced by add_thread_db_info().

struct target_ops thread_db_ops
static
sigset_t thread_print_set
static

Definition at line 134 of file linux-thread-db.c.

Referenced by check_thread_signals().

int thread_signals
static

Definition at line 132 of file linux-thread-db.c.

Referenced by check_thread_signals().

sigset_t thread_stop_set
static

Definition at line 133 of file linux-thread-db.c.

Referenced by check_thread_signals().