GDB (xrefs)
Classes | Functions | Variables
/home/stan/gdb/src/gdb/linux-thread-db.c File Reference
#include "defs.h"
#include "gdb_assert.h"
#include <dlfcn.h>
#include "gdb_proc_service.h"
#include "gdb_thread_db.h"
#include "gdb_vecs.h"
#include "bfd.h"
#include "command.h"
#include "exceptions.h"
#include "gdbcmd.h"
#include "gdbthread.h"
#include "inferior.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 "linux-procfs.h"
#include "linux-osdata.h"
#include "auto-load.h"
#include "cli/cli-utils.h"
#include <signal.h>
#include <ctype.h>

Go to the source code of this file.

Classes

struct  thread_db_info
struct  private_thread_info
struct  thread_get_info_inout
struct  callback_data

Functions

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 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 int thread_get_info_callback (const td_thrhandle_t *thp, void *argp)
static void thread_from_lwp (ptid_t ptid)
int thread_db_attach_lwp (ptid_t ptid)
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)
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)
static void check_thread_signals (void)
void check_for_thread_db (void)
static void thread_db_new_objfile (struct objfile *objfile)
static void thread_db_inferior_created (struct target_ops *target, int from_tty)
static void thread_db_detach (struct target_ops *ops, 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_find_new_threads (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 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 int thread_db_find_thread_from_tid (struct thread_info *thread, void *data)
static ptid_t thread_db_get_ada_task_ptid (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, read]
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_thread_signals ( void  ) [static]
static void delete_thread_db_info ( int  pid) [static]
static void detach_thread ( ptid_t  ptid) [static]
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 708 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, read]
static int has_libpthread ( void  ) [static]

Definition at line 1076 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 371 of file linux-thread-db.c.

References thread_info::private, 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 1907 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 set_libthread_db_search_path ( char *  ignored,
int  from_tty,
struct cmd_list_element c 
) [static]

Definition at line 94 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 85 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 109 of file linux-thread-db.c.

References _, and fprintf_filtered().

Referenced by _initialize_thread_db().

static void thread_db_detach ( struct target_ops ops,
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 thread_info info) [static]

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

References private_thread_info::dying, and thread_info::private.

Referenced by init_thread_db_ops().

static void thread_db_find_new_threads ( struct target_ops ops) [static]
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 int thread_db_find_thread_from_tid ( struct thread_info thread,
void *  data 
) [static]

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

References thread_info::private, and private_thread_info::tid.

Referenced by thread_db_get_ada_task_ptid().

static ptid_t thread_db_get_ada_task_ptid ( long  lwp,
long  thread 
) [static]
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 1214 of file linux-thread-db.c.

References check_for_thread_db().

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]
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 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 thread_get_info_callback ( const td_thrhandle_t thp,
void *  argp 
) [static]
static int try_thread_db_load ( const char *  library) [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 971 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* verbose_dlsym ( void *  handle,
const char *  name 
) [static]

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

References _, and warning().

Referenced by try_thread_db_load_1().


Variable Documentation

int auto_load_thread_db = 1 [static]
unsigned int libthread_db_debug [static]
char* libthread_db_search_path [static]

Definition at line 203 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 125 of file linux-thread-db.c.

Referenced by check_thread_signals().

int thread_signals [static]

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

Referenced by check_thread_signals().

sigset_t thread_stop_set [static]

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

Referenced by check_thread_signals().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines