GDB (xrefs)
Classes | Functions | Variables
/home/stan/gdb/src/gdb/thread.c File Reference
#include "defs.h"
#include "symtab.h"
#include "frame.h"
#include "inferior.h"
#include "environ.h"
#include "value.h"
#include "target.h"
#include "gdbthread.h"
#include "exceptions.h"
#include "command.h"
#include "gdbcmd.h"
#include "regcache.h"
#include "gdb.h"
#include "gdb_string.h"
#include "btrace.h"
#include <ctype.h>
#include <sys/types.h>
#include <signal.h>
#include "ui-out.h"
#include "observer.h"
#include "annotate.h"
#include "cli/cli-decode.h"
#include "gdb_regex.h"
#include "cli/cli-utils.h"
#include "continuations.h"

Go to the source code of this file.

Classes

struct  thread_array_cleanup
struct  current_thread_cleanup

Functions

void _initialize_thread (void)
static void thread_command (char *tidstr, int from_tty)
static void thread_apply_all_command (char *, int)
static int thread_alive (struct thread_info *)
static void info_threads_command (char *, int)
static void thread_apply_command (char *, int)
static void restore_current_thread (ptid_t)
static void prune_threads (void)
struct thread_infoinferior_thread (void)
void delete_step_resume_breakpoint (struct thread_info *tp)
void delete_exception_resume_breakpoint (struct thread_info *tp)
static void clear_thread_inferior_resources (struct thread_info *tp)
static void free_thread (struct thread_info *tp)
void init_thread_list (void)
static struct thread_infonew_thread (ptid_t ptid)
struct thread_infoadd_thread_silent (ptid_t ptid)
struct thread_infoadd_thread_with_info (ptid_t ptid, struct private_thread_info *private)
struct thread_infoadd_thread (ptid_t ptid)
static void delete_thread_1 (ptid_t ptid, int silent)
void delete_thread (ptid_t ptid)
void delete_thread_silent (ptid_t ptid)
struct thread_infofind_thread_id (int num)
struct thread_infofind_thread_ptid (ptid_t ptid)
struct thread_infoiterate_over_threads (int(*callback)(struct thread_info *, void *), void *data)
int thread_count (void)
int valid_thread_id (int num)
int pid_to_thread_id (ptid_t ptid)
ptid_t thread_id_to_pid (int num)
int in_thread_list (ptid_t ptid)
struct thread_infofirst_thread_of_process (int pid)
struct thread_infoany_thread_of_process (int pid)
struct thread_infoany_live_thread_of_process (int pid)
static int do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
enum gdb_rc gdb_list_thread_ids (struct ui_out *uiout, char **error_message)
void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid)
void set_running (ptid_t ptid, int running)
static int is_thread_state (ptid_t ptid, enum thread_state state)
int is_stopped (ptid_t ptid)
int is_exited (ptid_t ptid)
int is_running (ptid_t ptid)
int any_running (void)
int is_executing (ptid_t ptid)
void set_executing (ptid_t ptid, int executing)
void set_stop_requested (ptid_t ptid, int stop)
void finish_thread_state (ptid_t ptid)
void finish_thread_state_cleanup (void *arg)
int pc_in_thread_step_range (CORE_ADDR pc, struct thread_info *thread)
void print_thread_info (struct ui_out *uiout, char *requested_threads, int pid)
void switch_to_thread (ptid_t ptid)
static void restore_selected_frame (struct frame_id a_frame_id, int frame_level)
static void do_restore_current_thread_cleanup (void *arg)
static void restore_current_thread_cleanup_dtor (void *arg)
static void set_thread_refcount (void *data)
struct cleanupmake_cleanup_restore_current_thread (void)
static void thread_name_command (char *arg, int from_tty)
static void thread_find_command (char *arg, int from_tty)
static void show_print_thread_events (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
static int do_captured_thread_select (struct ui_out *uiout, void *tidstr)
enum gdb_rc gdb_thread_select (struct ui_out *uiout, char *tidstr, char **error_message)
void update_thread_list (void)
static struct valuethread_id_make_value (struct gdbarch *gdbarch, struct internalvar *var, void *ignore)

Variables

struct thread_infothread_list = NULL
static int highest_thread_num
int print_thread_events = 1
struct cmd_list_elementthread_cmd_list = NULL
static struct internalvar_funcs thread_funcs

Function Documentation

void _initialize_thread ( void  )
struct thread_info* add_thread ( ptid_t  ptid) [read]
struct thread_info* add_thread_silent ( ptid_t  ptid) [read]
struct thread_info* add_thread_with_info ( ptid_t  ptid,
struct private_thread_info private 
) [read]
struct thread_info* any_live_thread_of_process ( int  pid) [read]
int any_running ( void  )

Definition at line 651 of file thread.c.

References thread_info::next, thread_info::state, and THREAD_RUNNING.

struct thread_info* any_thread_of_process ( int  pid) [read]
static void clear_thread_inferior_resources ( struct thread_info tp) [static]
void delete_thread ( ptid_t  ptid)
static void delete_thread_1 ( ptid_t  ptid,
int  silent 
) [static]
void delete_thread_silent ( ptid_t  ptid)
static int do_captured_list_thread_ids ( struct ui_out uiout,
void *  arg 
) [static]
static int do_captured_thread_select ( struct ui_out uiout,
void *  tidstr 
) [static]
static void do_restore_current_thread_cleanup ( void *  arg) [static]
struct thread_info* find_thread_id ( int  num) [read]
struct thread_info* find_thread_ptid ( ptid_t  ptid) [read]
void finish_thread_state ( ptid_t  ptid)
void finish_thread_state_cleanup ( void *  arg)
struct thread_info* first_thread_of_process ( int  pid) [read]

Definition at line 453 of file thread.c.

References thread_info::next, thread_info::num, thread_info::ptid, and ptid_get_pid().

Referenced by core_open(), and extended_remote_attach_1().

static void free_thread ( struct thread_info tp) [static]
enum gdb_rc gdb_list_thread_ids ( struct ui_out uiout,
char **  error_message 
)
enum gdb_rc gdb_thread_select ( struct ui_out uiout,
char *  tidstr,
char **  error_message 
)
struct thread_info* inferior_thread ( void  ) [read]
static void info_threads_command ( char *  arg,
int  from_tty 
) [static]

Definition at line 984 of file thread.c.

References current_uiout, and print_thread_info().

void init_thread_list ( void  )
int is_executing ( ptid_t  ptid)
int is_exited ( ptid_t  ptid)
int is_running ( ptid_t  ptid)
int is_stopped ( ptid_t  ptid)
static int is_thread_state ( ptid_t  ptid,
enum thread_state  state 
) [static]

Definition at line 623 of file thread.c.

References find_thread_ptid(), gdb_assert, and thread_info::state.

Referenced by is_exited(), is_running(), and is_stopped().

struct thread_info* iterate_over_threads ( int(*)(struct thread_info *, void *)  callback,
void *  data 
) [read]
struct cleanup* make_cleanup_restore_current_thread ( void  ) [read]
static struct thread_info* new_thread ( ptid_t  ptid) [static, read]
int pc_in_thread_step_range ( CORE_ADDR  pc,
struct thread_info thread 
)
void print_thread_info ( struct ui_out uiout,
char *  requested_threads,
int  pid 
)
static void prune_threads ( void  ) [static]
static void restore_current_thread ( ptid_t  ptid) [static]

Definition at line 1025 of file thread.c.

References switch_to_thread().

Referenced by do_restore_current_thread_cleanup().

static void restore_current_thread_cleanup_dtor ( void *  arg) [static]
static void restore_selected_frame ( struct frame_id  a_frame_id,
int  frame_level 
) [static]
void set_executing ( ptid_t  ptid,
int  executing 
)
void set_running ( ptid_t  ptid,
int  running 
)
void set_stop_requested ( ptid_t  ptid,
int  stop 
)
static void set_thread_refcount ( void *  data) [static]
static void show_print_thread_events ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
) [static]

Definition at line 1429 of file thread.c.

References _, and fprintf_filtered().

void switch_to_thread ( ptid_t  ptid)
static int thread_alive ( struct thread_info tp) [static]
static void thread_apply_all_command ( char *  cmd,
int  from_tty 
) [static]
static void thread_apply_command ( char *  tidlist,
int  from_tty 
) [static]
void thread_change_ptid ( ptid_t  old_ptid,
ptid_t  new_ptid 
)
static void thread_command ( char *  tidstr,
int  from_tty 
) [static]
int thread_count ( void  )
static void thread_find_command ( char *  arg,
int  from_tty 
) [static]
static struct value* thread_id_make_value ( struct gdbarch gdbarch,
struct internalvar var,
void *  ignore 
) [static, read]

Definition at line 1500 of file thread.c.

References find_thread_ptid(), inferior_ptid, thread_info::num, and value_from_longest().

Definition at line 427 of file thread.c.

References find_thread_id(), pid_to_ptid(), and thread_info::ptid.

Referenced by set_sig_thread_cmd(), and value_of_root_1().

static void thread_name_command ( char *  arg,
int  from_tty 
) [static]
void update_thread_list ( void  )

Variable Documentation

Definition at line 58 of file thread.c.

Referenced by init_thread_list(), and new_thread().

Definition at line 1427 of file thread.c.

Referenced by add_thread_with_info(), exit_lwp(), procfs_wait(), and windows_delete_thread().

Definition at line 1510 of file thread.c.

Initial value:
{
  thread_id_make_value,
  NULL,
  NULL
}

Definition at line 1514 of file thread.c.

struct thread_info* thread_list = NULL

Definition at line 57 of file thread.c.

Referenced by darwin_check_new_threads(), and new_thread().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines