GDBserver
Classes | Defines | Functions | Variables
/home/stan/gdb/src/gdb/gdbserver/thread-db.c File Reference
#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.

Classes

struct  thread_db

Defines

#define CHK(required, a)

Functions

static int find_one_thread (ptid_t)
static int find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
static const char * thread_db_err_str (td_err_e err)
static int thread_db_create_event (CORE_ADDR where)
static int thread_db_enable_reporting (void)
static int attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p)
static int maybe_attach_thread (const td_thrhandle_t *th_p, td_thrinfo_t *ti_p, int *counter)
static void thread_db_find_new_threads (void)
static void thread_db_look_up_symbols (void)
int thread_db_look_up_one_symbol (const char *name, CORE_ADDR *addrp)
int thread_db_get_tls_address (struct thread_info *thread, CORE_ADDR offset, CORE_ADDR load_module, CORE_ADDR *address)
static int try_thread_db_load_1 (void *handle)
static int try_thread_db_load (const char *library)
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)
int thread_db_init (int use_events)
static int any_thread_of (struct inferior_list_entry *entry, void *args)
static void switch_to_process (struct process_info *proc)
static void disable_thread_event_reporting (struct process_info *proc)
static void remove_thread_event_breakpoints (struct process_info *proc)
void thread_db_detach (struct process_info *proc)
void thread_db_mourn (struct process_info *proc)
int thread_db_handle_monitor_command (char *mon)

Variables

int debug_threads
static int thread_db_use_events
static char * libthread_db_search_path

Define Documentation

#define CHK (   required,
 
)
Value:
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().


Function Documentation

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]
static void disable_thread_event_reporting ( struct process_info proc) [static]
static int find_new_threads_callback ( const td_thrhandle_t th_p,
void *  data 
) [static]
static int find_one_thread ( ptid_t  ptid) [static]
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]
static void switch_to_process ( struct process_info proc) [static]
static int thread_db_create_event ( CORE_ADDR  where) [static]
void thread_db_detach ( struct process_info proc)
static int thread_db_enable_reporting ( void  ) [static]
static const char* thread_db_err_str ( td_err_e  err) [static]
static void thread_db_find_new_threads ( void  ) [static]
int thread_db_get_tls_address ( struct thread_info thread,
CORE_ADDR  offset,
CORE_ADDR  load_module,
CORE_ADDR address 
)
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)
static int thread_db_load_search ( void  ) [static]
int thread_db_look_up_one_symbol ( const char *  name,
CORE_ADDR addrp 
)
static void thread_db_look_up_symbols ( void  ) [static]
void thread_db_mourn ( struct process_info proc)
static int try_thread_db_load ( const char *  library) [static]
static int try_thread_db_load_1 ( void *  handle) [static]
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().


Variable Documentation

Definition at line 71 of file server.c.

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().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines