GDB (xrefs)
Classes | Macros | Typedefs | Enumerations | Functions | Variables
/tmp/gdb-8.1/gdb/gdbthread.h File Reference
#include "breakpoint.h"
#include "frame.h"
#include "ui-out.h"
#include "inferior.h"
#include "btrace.h"
#include "common/vec.h"
#include "target/waitstatus.h"
#include "cli/cli-utils.h"
#include "common/refcounted-object.h"
#include "common-gdbthread.h"

Go to the source code of this file.

Classes

struct  thread_control_state
 
struct  thread_suspend_state
 
struct  private_thread_info
 
class  thread_info
 
struct  thread_info::btrace
 
class  scoped_restore_current_thread
 

Macros

#define ALL_THREADS(T)   for (T = thread_list; T; T = T->next) \
 
#define ALL_THREADS_BY_INFERIOR(inf, tp)
 
#define ALL_NON_EXITED_THREADS(T)
 
#define ALL_THREADS_SAFE(T, TMP)
 

Typedefs

typedef struct valuevalue_ptr
 
typedef int(* thread_callback_func) (struct thread_info *, void *)
 

Enumerations

enum  thread_state { THREAD_STOPPED, THREAD_RUNNING, THREAD_EXITED }
 

Functions

 DEF_VEC_P (value_ptr)
 
typedef VEC (value_ptr) value_vec
 
void init_thread_list (void)
 
struct thread_infoadd_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 *)
 
void delete_thread (ptid_t)
 
void delete_thread_silent (ptid_t)
 
void delete_step_resume_breakpoint (struct thread_info *)
 
void delete_exception_resume_breakpoint (struct thread_info *)
 
void delete_single_step_breakpoints (struct thread_info *tp)
 
int thread_has_single_step_breakpoints_set (struct thread_info *tp)
 
int thread_has_single_step_breakpoint_here (struct thread_info *tp, const address_space *aspace, CORE_ADDR addr)
 
ptid_t global_thread_id_to_ptid (int num)
 
int ptid_to_global_thread_id (ptid_t ptid)
 
int show_inferior_qualified_tids (void)
 
const char * print_thread_id (struct thread_info *thr)
 
int in_thread_list (ptid_t ptid)
 
int valid_global_thread_id (int global_id)
 
struct thread_infofind_thread_ptid (ptid_t ptid)
 
struct thread_infofind_thread_global_id (int global_id)
 
struct thread_infofind_thread_by_handle (struct value *thread_handle, struct inferior *inf)
 
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)
 
void thread_change_ptid (ptid_t old_ptid, ptid_t new_ptid)
 
struct thread_infoiterate_over_threads (thread_callback_func, void *)
 
int thread_count (void)
 
void switch_to_thread_no_regs (struct thread_info *thread)
 
void set_resumed (ptid_t ptid, int resumed)
 
void set_running (ptid_t ptid, int running)
 
void set_stop_requested (ptid_t ptid, int stop)
 
int is_running (ptid_t ptid)
 
int is_exited (ptid_t ptid)
 
int is_stopped (ptid_t ptid)
 
void set_executing (ptid_t ptid, int executing)
 
int is_executing (ptid_t ptid)
 
int threads_are_executing (void)
 
void finish_thread_state (ptid_t ptid)
 
void finish_thread_state_cleanup (void *ptid_p)
 
void thread_command (const char *tidstr, int from_tty)
 
void print_thread_info (struct ui_out *uiout, char *requested_threads, int pid)
 
struct thread_infoinferior_thread (void)
 
void update_thread_list (void)
 
void prune_threads (void)
 
void delete_exited_threads (void)
 
int pc_in_thread_step_range (CORE_ADDR pc, struct thread_info *thread)
 
struct cleanupenable_thread_stack_temporaries (ptid_t ptid)
 
int thread_stack_temporaries_enabled_p (ptid_t ptid)
 
void push_thread_stack_temporary (ptid_t ptid, struct value *v)
 
struct valueget_last_thread_stack_temporary (ptid_t)
 
int value_in_thread_stack_temporaries (struct value *, ptid_t)
 
void thread_step_over_chain_enqueue (struct thread_info *tp)
 
void thread_step_over_chain_remove (struct thread_info *tp)
 
struct thread_infothread_step_over_chain_next (struct thread_info *tp)
 
int thread_is_in_step_over_chain (struct thread_info *tp)
 
void thread_cancel_execution_command (struct thread_info *thr)
 
void validate_registers_access (void)
 
bool can_access_registers_ptid (ptid_t ptid)
 
int show_thread_that_caused_stop (void)
 
void print_selected_thread_frame (struct ui_out *uiout, user_selected_what selection)
 
void thread_select (const char *tidstr, class thread_info *thr)
 

Variables

struct cmd_list_elementthread_cmd_list
 
int print_thread_events
 
struct thread_infothread_list
 

Macro Definition Documentation

◆ ALL_NON_EXITED_THREADS

#define ALL_NON_EXITED_THREADS (   T)

◆ ALL_THREADS

#define ALL_THREADS (   T)    for (T = thread_list; T; T = T->next) \

Definition at line 478 of file gdbthread.h.

Referenced by parse_thread_id(), and thread_info_from_private_thread_info().

◆ ALL_THREADS_BY_INFERIOR

#define ALL_THREADS_BY_INFERIOR (   inf,
  tp 
)
Value:
ALL_THREADS (tp) \
if (inf == tp->inf)
#define ALL_INFERIORS(I)
Definition: inferior.h:548
Definition: gnu-nat.c:174

Definition at line 482 of file gdbthread.h.

Referenced by print_thread_info_1().

◆ ALL_THREADS_SAFE

#define ALL_THREADS_SAFE (   T,
  TMP 
)
Value:
for ((T) = thread_list; \
(T) != NULL ? ((TMP) = (T)->next, 1): 0; \
(T) = (TMP))
struct thread_info * thread_list
Definition: thread.c:53

Definition at line 496 of file gdbthread.h.

Referenced by delete_exited_threads(), follow_exec(), prune_threads(), and remote_update_thread_list().

Typedef Documentation

◆ thread_callback_func

typedef int(* thread_callback_func) (struct thread_info *, void *)

Definition at line 474 of file gdbthread.h.

◆ value_ptr

typedef struct value* value_ptr

Definition at line 178 of file gdbthread.h.

Enumeration Type Documentation

◆ thread_state

Enumerator
THREAD_STOPPED 
THREAD_RUNNING 
THREAD_EXITED 

Definition at line 39 of file gdbthread.h.

Function Documentation

◆ add_thread()

struct thread_info* add_thread ( ptid_t  ptid)

◆ add_thread_silent()

struct thread_info* add_thread_silent ( ptid_t  ptid)

◆ add_thread_with_info()

struct thread_info* add_thread_with_info ( ptid_t  ptid,
struct private_thread_info  
)

◆ any_live_thread_of_process()

struct thread_info* any_live_thread_of_process ( int  pid)

◆ any_thread_of_process()

struct thread_info* any_thread_of_process ( int  pid)

◆ can_access_registers_ptid()

bool can_access_registers_ptid ( ptid_t  ptid)

Definition at line 1123 of file thread.c.

References is_executing(), is_exited(), null_ptid, and thread_info::ptid.

Referenced by btrace_enable(), and btrace_fetch().

◆ DEF_VEC_P()

DEF_VEC_P ( value_ptr  )

◆ delete_exception_resume_breakpoint()

void delete_exception_resume_breakpoint ( struct thread_info )

◆ delete_exited_threads()

void delete_exited_threads ( void  )

◆ delete_single_step_breakpoints()

void delete_single_step_breakpoints ( struct thread_info tp)

◆ delete_step_resume_breakpoint()

void delete_step_resume_breakpoint ( struct thread_info )

◆ delete_thread()

void delete_thread ( ptid_t  )

◆ delete_thread_silent()

void delete_thread_silent ( ptid_t  )

◆ enable_thread_stack_temporaries()

struct cleanup* enable_thread_stack_temporaries ( ptid_t  ptid)

◆ find_thread_by_handle()

struct thread_info* find_thread_by_handle ( struct value thread_handle,
struct inferior inf 
)

◆ find_thread_global_id()

struct thread_info* find_thread_global_id ( int  global_id)

◆ find_thread_ptid()

struct thread_info* find_thread_ptid ( ptid_t  ptid)

Definition at line 514 of file thread.c.

References thread_info::next, thread_info::ptid, and thread_list.

Referenced by add_thread_silent(), aix_thread_fetch_registers(), aix_thread_resume(), aix_thread_store_registers(), append_resumption(), bpstat_clear_actions(), btrace_func_from_recpy_func(), btrace_insn_from_recpy_insn(), call_function_by_hand_dummy(), cli_on_user_selected_context_changed(), continue_command(), delete_checkpoint_command(), disable_thread_stack_temporaries(), displaced_step_prepare_throw(), do_target_wait(), enable_thread_stack_temporaries(), exit_lwp(), find_new_threads_callback(), finish_thread_state(), follow_fork(), get_detach_signal(), get_last_thread_stack_temporary(), get_remote_thread_info(), handle_inferior_event_1(), inferior_thread(), info_program_command(), is_executing(), is_thread_state(), linux_nat_resume_callback(), linux_nat_stop_lwp(), maint_btrace_clear_cmd(), maint_btrace_clear_packet_history_cmd(), maint_btrace_packet_history_cmd(), maint_info_btrace_cmd(), mi_on_resume(), mi_on_resume_1(), mi_user_selected_context_changed(), notice_new_inferior(), process_initial_stop_replies(), procfs_update_thread_list(), push_thread_stack_temporary(), python_on_normal_stop(), ravenscar_add_thread(), ravenscar_update_inferior_ptid(), record_btrace_fetch_registers(), record_btrace_frame_sniffer(), record_btrace_info(), record_btrace_record_method(), record_btrace_tailcall_frame_sniffer(), record_btrace_thread_alive(), recpy_bt_begin(), recpy_bt_end(), recpy_bt_format(), recpy_bt_func_level(), recpy_bt_function_call_history(), recpy_bt_goto(), recpy_bt_instruction_history(), recpy_bt_replay_position(), remote_core_of_thread(), remote_detach_1(), remote_threads_extra_info(), require_btrace_thread(), run_inferior_call(), scoped_restore_current_thread::scoped_restore_current_thread(), set_executing(), set_resumed(), set_running(), set_stop_requested(), stop_all_threads(), switch_to_thread(), task_command_1(), thread_change_ptid(), thread_db_get_thread_local_address(), thread_db_pid_to_str(), thread_from_lwp(), thread_num_make_value_helper(), thread_stack_temporaries_enabled_p(), tui_on_user_selected_context_changed(), and value_in_thread_stack_temporaries().

◆ finish_thread_state()

void finish_thread_state ( ptid_t  ptid)

◆ finish_thread_state_cleanup()

void finish_thread_state_cleanup ( void *  ptid_p)

◆ first_thread_of_process()

struct thread_info* first_thread_of_process ( int  pid)

◆ get_last_thread_stack_temporary()

struct value* get_last_thread_stack_temporary ( ptid_t  )

◆ global_thread_id_to_ptid()

ptid_t global_thread_id_to_ptid ( int  num)

Definition at line 617 of file thread.c.

References find_thread_global_id(), minus_one_ptid, and thread_info::ptid.

Referenced by value_of_root_1().

◆ in_thread_list()

int in_thread_list ( ptid_t  ptid)

◆ inferior_thread()

struct thread_info* inferior_thread ( void  )

Definition at line 90 of file thread.c.

References find_thread_ptid(), gdb_assert, and inferior_ptid.

Referenced by any_live_thread_of_process(), any_thread_of_process(), arm_linux_copy_svc(), attach_post_wait(), bpstat_do_actions(), breakpoint_about_to_proceed(), call_function_by_hand_dummy(), clear_proceed_status(), cli_on_normal_stop(), do_target_resume(), fbsd_make_corefile_notes(), finish_backward(), finish_command(), finish_forward(), follow_exec(), follow_fork(), follow_fork_inferior(), follow_inferior_reset_breakpoints(), for_each_just_stopped_thread(), handle_inferior_event_1(), insert_exception_resume_breakpoint(), insert_exception_resume_from_probe(), insert_longjmp_resume_breakpoint(), insert_single_step_breakpoint(), insert_step_resume_breakpoint_at_sal_1(), linux_child_follow_fork(), linux_make_corefile_notes(), maybe_print_thread_hit_breakpoint(), mi_about_to_proceed(), mi_execute_command(), mi_on_normal_stop_1(), mi_on_resume(), normal_stop(), prepare_one_step(), print_selected_thread_frame(), print_signal_received_reason(), print_stop_event(), print_stop_location(), print_thread_info_1(), proceed(), process_initial_stop_replies(), python_on_normal_stop(), queue_signal_command(), record_btrace_stopped_by_hw_breakpoint(), record_btrace_stopped_by_sw_breakpoint(), record_full_resume(), remote_follow_fork(), remote_stopped_by_hw_breakpoint(), remote_stopped_by_sw_breakpoint(), remote_stopped_by_watchpoint(), remote_stopped_data_address(), restore_infcall_control_state(), restore_infcall_suspend_state(), resume(), resume_1(), run_command_1(), save_infcall_control_state(), save_infcall_suspend_state(), save_stop_context(), set_step_frame(), set_step_info(), signal_command(), spu_skip_standalone_loader(), step_1(), thread_command(), thread_name_command(), tui_on_normal_stop(), until_break_command(), and until_next_command().

◆ init_thread_list()

void init_thread_list ( void  )

◆ is_executing()

int is_executing ( ptid_t  ptid)

◆ is_exited()

int is_exited ( ptid_t  ptid)

◆ is_running()

int is_running ( ptid_t  ptid)

◆ is_stopped()

int is_stopped ( ptid_t  ptid)

◆ iterate_over_threads()

struct thread_info* iterate_over_threads ( thread_callback_func  ,
void *   
)

◆ pc_in_thread_step_range()

int pc_in_thread_step_range ( CORE_ADDR  pc,
struct thread_info thread 
)

◆ print_selected_thread_frame()

void print_selected_thread_frame ( struct ui_out uiout,
user_selected_what  selection 
)

◆ print_thread_id()

const char* print_thread_id ( struct thread_info thr)

◆ print_thread_info()

void print_thread_info ( struct ui_out uiout,
char *  requested_threads,
int  pid 
)

Definition at line 1367 of file thread.c.

References pid, and print_thread_info_1().

Referenced by mi_cmd_list_thread_groups(), mi_cmd_thread_info(), and print_one_inferior().

◆ prune_threads()

void prune_threads ( void  )

◆ ptid_to_global_thread_id()

int ptid_to_global_thread_id ( ptid_t  ptid)

◆ push_thread_stack_temporary()

void push_thread_stack_temporary ( ptid_t  ptid,
struct value v 
)

◆ set_executing()

void set_executing ( ptid_t  ptid,
int  executing 
)

◆ set_resumed()

void set_resumed ( ptid_t  ptid,
int  resumed 
)

◆ set_running()

void set_running ( ptid_t  ptid,
int  running 
)

◆ set_stop_requested()

void set_stop_requested ( ptid_t  ptid,
int  stop 
)

◆ show_inferior_qualified_tids()

int show_inferior_qualified_tids ( void  )

Definition at line 1594 of file thread.c.

References inferior_list, inferior::next, and inferior::num.

Referenced by parse_thread_id(), print_thread_id(), and thread_apply_command().

◆ show_thread_that_caused_stop()

int show_thread_that_caused_stop ( void  )

Definition at line 1586 of file thread.c.

References highest_thread_num.

Referenced by maybe_print_thread_hit_breakpoint(), and print_signal_received_reason().

◆ switch_to_thread_no_regs()

void switch_to_thread_no_regs ( struct thread_info thread)

◆ thread_cancel_execution_command()

void thread_cancel_execution_command ( struct thread_info thr)

◆ thread_change_ptid()

void thread_change_ptid ( ptid_t  old_ptid,
ptid_t  new_ptid 
)

◆ thread_command()

void thread_command ( const char *  tidstr,
int  from_tty 
)

◆ thread_count()

int thread_count ( void  )

◆ thread_has_single_step_breakpoint_here()

int thread_has_single_step_breakpoint_here ( struct thread_info tp,
const address_space aspace,
CORE_ADDR  addr 
)

◆ thread_has_single_step_breakpoints_set()

int thread_has_single_step_breakpoints_set ( struct thread_info tp)

◆ thread_is_in_step_over_chain()

int thread_is_in_step_over_chain ( struct thread_info tp)

◆ thread_select()

void thread_select ( const char *  tidstr,
class thread_info thr 
)

◆ thread_stack_temporaries_enabled_p()

int thread_stack_temporaries_enabled_p ( ptid_t  ptid)

◆ thread_step_over_chain_enqueue()

void thread_step_over_chain_enqueue ( struct thread_info tp)

◆ thread_step_over_chain_next()

struct thread_info* thread_step_over_chain_next ( struct thread_info tp)

Definition at line 408 of file thread.c.

References thread_info::next, thread_info::step_over_next, and step_over_queue_head.

Referenced by start_step_over().

◆ thread_step_over_chain_remove()

void thread_step_over_chain_remove ( struct thread_info tp)

◆ threads_are_executing()

int threads_are_executing ( void  )

Definition at line 1021 of file thread.c.

References threads_executing.

Referenced by breakpoints_should_be_inserted_now().

◆ update_thread_list()

void update_thread_list ( void  )

◆ valid_global_thread_id()

int valid_global_thread_id ( int  global_id)

◆ validate_registers_access()

void validate_registers_access ( void  )

◆ value_in_thread_stack_temporaries()

int value_in_thread_stack_temporaries ( struct value ,
ptid_t   
)

◆ VEC()

typedef VEC ( value_ptr  )

Variable Documentation

◆ print_thread_events

int print_thread_events

◆ thread_cmd_list

struct cmd_list_element* thread_cmd_list

Definition at line 2049 of file thread.c.

◆ thread_list

struct thread_info* thread_list