GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
thread.c File Reference
#include "defs.h"
#include "symtab.h"
#include "frame.h"
#include "inferior.h"
#include "gdbsupport/environ.h"
#include "value.h"
#include "target.h"
#include "gdbthread.h"
#include "command.h"
#include "gdbcmd.h"
#include "regcache.h"
#include "btrace.h"
#include <ctype.h>
#include <sys/types.h>
#include <signal.h>
#include "ui-out.h"
#include "observable.h"
#include "annotate.h"
#include "cli/cli-decode.h"
#include "cli/cli-option.h"
#include "gdbsupport/gdb_regex.h"
#include "cli/cli-utils.h"
#include "thread-fsm.h"
#include "tid-parse.h"
#include <algorithm>
#include "gdbsupport/gdb_optional.h"
#include "inline-frame.h"
#include "stack.h"

Go to the source code of this file.

Classes

struct  info_threads_opts
 

Macros

#define THREAD_APPLY_OPTION_HELP   "\Prints per-inferior thread number and target system's thread id\n\followed by COMMAND output.\n\\n\By default, an error raised during the execution of COMMAND\n\aborts \"thread apply\".\n\\n\Options:\n\%OPTIONS%"
 

Typedefs

using qcs_flag_option_def = gdb::option::flag_option_def< qcs_flags >
 

Functions

static void show_debug_threads (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static bool is_current_thread (const thread_info *thr)
 
struct thread_infoinferior_thread (void)
 
static void delete_thread_breakpoint (struct breakpoint **bp_p)
 
void delete_step_resume_breakpoint (struct thread_info *tp)
 
void delete_exception_resume_breakpoint (struct thread_info *tp)
 
void delete_single_step_breakpoints (struct thread_info *tp)
 
static void delete_at_next_stop (struct breakpoint **bp)
 
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)
 
void thread_cancel_execution_command (struct thread_info *thr)
 
static void clear_thread_inferior_resources (struct thread_info *tp)
 
void set_thread_exited (thread_info *tp, bool silent)
 
void init_thread_list (void)
 
static struct thread_infonew_thread (struct inferior *inf, ptid_t ptid)
 
struct thread_infoadd_thread_silent (process_stratum_target *targ, ptid_t ptid)
 
struct thread_infoadd_thread_with_info (process_stratum_target *targ, ptid_t ptid, private_thread_info *priv)
 
struct thread_infoadd_thread (process_stratum_target *targ, ptid_t ptid)
 
int thread_is_in_step_over_chain (struct thread_info *tp)
 
int thread_step_over_chain_length (const thread_step_over_list &l)
 
void global_thread_step_over_chain_enqueue (struct thread_info *tp)
 
void global_thread_step_over_chain_enqueue_chain (thread_step_over_list &&list)
 
void global_thread_step_over_chain_remove (struct thread_info *tp)
 
static void delete_thread_1 (thread_info *thr, bool silent)
 
void delete_thread (thread_info *thread)
 
void delete_thread_silent (thread_info *thread)
 
struct thread_infofind_thread_global_id (int global_id)
 
static struct thread_infofind_thread_id (struct inferior *inf, int thr_num)
 
struct thread_infofind_thread_ptid (process_stratum_target *targ, ptid_t ptid)
 
struct thread_infofind_thread_ptid (inferior *inf, ptid_t ptid)
 
struct thread_infofind_thread_by_handle (gdb::array_view< const gdb_byte > handle, struct inferior *inf)
 
struct thread_infoiterate_over_threads (int(*callback)(struct thread_info *, void *), void *data)
 
bool any_thread_p ()
 
int thread_count (process_stratum_target *proc_target)
 
static int live_threads_count (void)
 
int valid_global_thread_id (int global_id)
 
bool in_thread_list (process_stratum_target *targ, ptid_t ptid)
 
thread_infofirst_thread_of_inferior (inferior *inf)
 
thread_infoany_thread_of_inferior (inferior *inf)
 
thread_infoany_live_thread_of_inferior (inferior *inf)
 
static bool thread_alive (thread_info *tp)
 
bool switch_to_thread_if_alive (thread_info *thr)
 
void prune_threads (void)
 
void delete_exited_threads (void)
 
bool thread_stack_temporaries_enabled_p (thread_info *tp)
 
void push_thread_stack_temporary (thread_info *tp, struct value *v)
 
bool value_in_thread_stack_temporaries (struct value *val, thread_info *tp)
 
valueget_last_thread_stack_temporary (thread_info *tp)
 
void thread_change_ptid (process_stratum_target *targ, ptid_t old_ptid, ptid_t new_ptid)
 
void set_resumed (process_stratum_target *targ, ptid_t ptid, bool resumed)
 
static bool set_running_thread (struct thread_info *tp, bool running)
 
void set_running (process_stratum_target *targ, ptid_t ptid, bool running)
 
void set_executing (process_stratum_target *targ, ptid_t ptid, bool executing)
 
bool threads_are_executing (process_stratum_target *target)
 
void set_stop_requested (process_stratum_target *targ, ptid_t ptid, bool stop)
 
void finish_thread_state (process_stratum_target *targ, ptid_t ptid)
 
void validate_registers_access (void)
 
bool can_access_registers_thread (thread_info *thread)
 
int pc_in_thread_step_range (CORE_ADDR pc, struct thread_info *thread)
 
static int should_print_thread (const char *requested_threads, int default_inf_num, int global_ids, int pid, struct thread_info *thr)
 
static std::string thread_target_id_str (thread_info *tp)
 
static void print_thread_info_1 (struct ui_out *uiout, const char *requested_threads, int global_ids, int pid, int show_global_ids)
 
void print_thread_info (struct ui_out *uiout, const char *requested_threads, int pid)
 
static gdb::option::option_def_group make_info_threads_options_def_group (info_threads_opts *it_opts)
 
static void info_threads_command (const char *arg, int from_tty)
 
static void info_threads_command_completer (struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word_ignored)
 
void switch_to_thread_no_regs (struct thread_info *thread)
 
void switch_to_no_thread ()
 
void switch_to_thread (thread_info *thr)
 
void switch_to_thread (process_stratum_target *proc_target, ptid_t ptid)
 
int show_thread_that_caused_stop (void)
 
int show_inferior_qualified_tids (void)
 
const char * print_thread_id (struct thread_info *thr)
 
static bool tp_array_compar_ascending (const thread_info_ref &a, const thread_info_ref &b)
 
static bool tp_array_compar_descending (const thread_info_ref &a, const thread_info_ref &b)
 
void thread_try_catch_cmd (thread_info *thr, gdb::optional< int > ada_task, const char *cmd, int from_tty, const qcs_flags &flags)
 
static std::array< gdb::option::option_def_group, 2 > make_thread_apply_all_options_def_group (bool *ascending, qcs_flags *flags)
 
static gdb::option::option_def_group make_thread_apply_options_def_group (qcs_flags *flags)
 
static void thread_apply_all_command (const char *cmd, int from_tty)
 
static void thread_apply_command_completer (cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
 
static void thread_apply_all_command_completer (cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
 
static void thread_apply_command (const char *tidlist, int from_tty)
 
static void taas_command (const char *cmd, int from_tty)
 
static void tfaas_command (const char *cmd, int from_tty)
 
void thread_command (const char *tidstr, int from_tty)
 
static void thread_name_command (const char *arg, int from_tty)
 
static void thread_find_command (const 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)
 
void thread_select (const char *tidstr, thread_info *tp)
 
void print_selected_thread_frame (struct ui_out *uiout, user_selected_what selection)
 
static void update_threads_executing (void)
 
void update_thread_list (void)
 
const char * thread_name (thread_info *thread)
 
const char * thread_state_string (enum thread_state state)
 
static struct valuethread_num_make_value_helper (struct gdbarch *gdbarch, int global)
 
static struct valuethread_id_per_inf_num_make_value (struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
 
static struct valueglobal_thread_id_make_value (struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
 
static struct valueinferior_thread_count_make_value (struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
 
void _initialize_thread ()
 

Variables

bool debug_threads = false
 
static int highest_thread_num
 
static thread_infocurrent_thread_
 
static const gdb::option::option_def info_threads_option_defs []
 
static const gdb::option::flag_option_def ascending_option_def
 
static const gdb::option::option_def thr_qcs_flags_option_defs []
 
bool print_thread_events = true
 
struct cmd_list_elementthread_cmd_list = NULL
 
static const struct internalvar_funcs thread_funcs
 
static const struct internalvar_funcs gthread_funcs
 
static const struct internalvar_funcs inferior_thread_count_funcs
 

Macro Definition Documentation

◆ THREAD_APPLY_OPTION_HELP

#define THREAD_APPLY_OPTION_HELP   "\Prints per-inferior thread number and target system's thread id\n\followed by COMMAND output.\n\\n\By default, an error raised during the execution of COMMAND\n\aborts \"thread apply\".\n\\n\Options:\n\%OPTIONS%"

Typedef Documentation

◆ qcs_flag_option_def

Definition at line 1526 of file thread.c.

Function Documentation

◆ _initialize_thread()

void _initialize_thread ( )

Definition at line 2171 of file thread.c.

Referenced by initialize_all_files().

◆ add_thread()

struct thread_info * add_thread ( process_stratum_target targ,
ptid_t  ptid 
)

◆ add_thread_silent()

struct thread_info * add_thread_silent ( process_stratum_target targ,
ptid_t  ptid 
)

◆ add_thread_with_info()

struct thread_info * add_thread_with_info ( process_stratum_target targ,
ptid_t  ptid,
private_thread_info priv 
)

◆ any_live_thread_of_inferior()

thread_info * any_live_thread_of_inferior ( inferior inf)

◆ any_thread_of_inferior()

thread_info * any_thread_of_inferior ( inferior inf)

◆ any_thread_p()

bool any_thread_p ( )

Definition at line 578 of file thread.c.

References all_threads().

Referenced by inferior_appeared().

◆ can_access_registers_thread()

bool can_access_registers_thread ( thread_info thread)

Definition at line 954 of file thread.c.

References thread_info::executing(), thread_info::state, and THREAD_EXITED.

Referenced by btrace_enable(), and btrace_fetch().

◆ clear_thread_inferior_resources()

static void clear_thread_inferior_resources ( struct thread_info tp)
static

◆ delete_at_next_stop()

static void delete_at_next_stop ( struct breakpoint **  bp)
static

Definition at line 128 of file thread.c.

References bp, and disp_del_at_next_stop.

Referenced by clear_thread_inferior_resources().

◆ delete_exception_resume_breakpoint()

void delete_exception_resume_breakpoint ( struct thread_info tp)

◆ 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 tp)

◆ delete_thread()

void delete_thread ( thread_info thread)

◆ delete_thread_1()

static void delete_thread_1 ( thread_info thr,
bool  silent 
)
static

◆ delete_thread_breakpoint()

static void delete_thread_breakpoint ( struct breakpoint **  bp_p)
static

◆ delete_thread_silent()

void delete_thread_silent ( thread_info thread)

Definition at line 489 of file thread.c.

References delete_thread_1().

◆ find_thread_by_handle()

struct thread_info * find_thread_by_handle ( gdb::array_view< const gdb_byte >  handle,
struct inferior inf 
)

Definition at line 542 of file thread.c.

References target_thread_handle_to_thread_info().

Referenced by infpy_thread_from_thread_handle().

◆ find_thread_global_id()

struct thread_info * find_thread_global_id ( int  global_id)

◆ find_thread_id()

static struct thread_info * find_thread_id ( struct inferior inf,
int  thr_num 
)
static

Definition at line 505 of file thread.c.

References inf::threads.

Referenced by thread_apply_command().

◆ find_thread_ptid() [1/2]

struct thread_info * find_thread_ptid ( inferior inf,
ptid_t  ptid 
)

Definition at line 528 of file thread.c.

Referenced by ravenscar_thread_target::add_active_thread(), ravenscar_thread_target::add_thread(), all_matching_threads_iterator::all_matching_threads_iterator(), remote_target::append_resumption(), gnu_nat_target::attach(), nto_procfs_target::attach(), darwin_nat_target::check_new_threads(), check_thread_db_callback(), continue_command(), remote_target::core_of_thread(), nto_procfs_target::create_inferior(), delete_checkpoint_command(), windows_nat_target::delete_thread(), detach_one_lwp(), windows_nat_target::do_initial_windows_stuff(), do_target_wait_1(), ravenscar_thread_target::enable_btrace(), exit_lwp(), aix_thread_target::fetch_registers(), record_btrace_target::fetch_registers(), find_new_threads_callback(), follow_fork(), follow_fork_inferior(), get_detach_signal(), get_remote_thread_info(), thread_db_target::get_thread_local_address(), handle_inferior_event(), handle_one(), info_program_command(), linux_handle_syscall_trap(), linux_nat_filter_event(), linux_nat_resume_callback(), linux_nat_stop_lwp(), maint_btrace_packet_history_cmd(), mi_on_resume(), thread_db_target::pid_to_str(), print_ada_task_info(), remote_target::process_initial_stop_replies(), procfs_notice_thread(), py_get_event_thread(), record_btrace_target::record_method(), remote_target::remote_detach_1(), remote_target::remote_notice_new_inferior(), aix_thread_target::resume(), ravenscar_thread_target::set_base_thread_from_ravenscar_task(), sol_update_thread_list_callback(), remote_target::start_remote_1(), aix_thread_target::store_registers(), task_apply_all_command(), task_apply_command(), task_command_1(), thread_db_notice_clone(), thread_from_lwp(), bsd_uthread_target::update_thread_list(), nto_procfs_target::update_thread_list(), remote_target::update_thread_list(), bsd_uthread_target::wait(), thread_db_target::wait(), nbsd_nat_target::wait(), procfs_target::wait(), sol_thread_target::wait(), and fbsd_nat_target::wait_1().

◆ find_thread_ptid() [2/2]

struct thread_info * find_thread_ptid ( process_stratum_target targ,
ptid_t  ptid 
)

◆ finish_thread_state()

void finish_thread_state ( process_stratum_target targ,
ptid_t  ptid 
)

◆ first_thread_of_inferior()

thread_info * first_thread_of_inferior ( inferior inf)

Definition at line 620 of file thread.c.

Referenced by extended_remote_target::attach(), and core_target_open().

◆ get_last_thread_stack_temporary()

value * get_last_thread_stack_temporary ( thread_info tp)

Definition at line 780 of file thread.c.

References thread_info::stack_temporaries.

Referenced by call_function_by_hand_dummy().

◆ global_thread_id_make_value()

static struct value * global_thread_id_make_value ( struct gdbarch gdbarch,
struct internalvar var,
void *  ignore 
)
static

Definition at line 2120 of file thread.c.

References thread_num_make_value_helper().

◆ global_thread_step_over_chain_enqueue()

void global_thread_step_over_chain_enqueue ( struct thread_info tp)

◆ global_thread_step_over_chain_enqueue_chain()

void global_thread_step_over_chain_enqueue_chain ( thread_step_over_list &&  list)

Definition at line 435 of file thread.c.

References global_thread_step_over_list.

Referenced by start_step_over().

◆ global_thread_step_over_chain_remove()

void global_thread_step_over_chain_remove ( struct thread_info tp)

◆ in_thread_list()

bool in_thread_list ( process_stratum_target targ,
ptid_t  ptid 
)

◆ inferior_thread()

struct thread_info * inferior_thread ( void  )

Definition at line 83 of file thread.c.

References current_thread_.

Referenced by any_live_thread_of_inferior(), any_thread_of_inferior(), arm_linux_copy_svc(), attach_post_wait(), bpfinishpy_init(), bpstat_clear_actions(), breakpoint_about_to_proceed(), breakpoint_re_set_thread(), call_function_by_hand_dummy(), clean_up_just_stopped_threads_fsms(), clear_proceed_status(), cli_base_on_normal_stop(), cli_base_on_user_selected_context_changed(), context_switch(), continue_command(), display_current_task_id(), do_target_resume(), dummy_frame_sniffer(), elf_gnu_ifunc_resolver_return_stop(), elf_gnu_ifunc_resolver_stop(), ensure_not_running(), ensure_valid_thread(), expression::evaluate(), execute_command(), fbsd_make_corefile_notes(), fetch_inferior_event(), find_frame_sal(), finish_backward(), finish_command(), finish_forward(), follow_exec(), follow_fork(), follow_fork_inferior(), follow_inferior_reset_breakpoints(), for_each_just_stopped_thread(), fork_load_infrun_state(), frame_inlined_callees(), frame_pop(), frame_show_address(), gcore_find_signalled_thread(), gdbpy_current_recording(), gdbpy_selected_thread(), get_bpstat_thread(), get_call_return_value(), get_current_regcache(), handle_inferior_event(), has_stack_frames(), record_btrace_target::info_record(), inline_frame_sniffer(), insert_exception_resume_breakpoint(), insert_exception_resume_from_probe(), insert_longjmp_resume_breakpoint(), insert_single_step_breakpoint(), insert_step_resume_breakpoint_at_sal_1(), maint_btrace_clear_cmd(), maint_btrace_clear_packet_history_cmd(), maint_info_btrace_cmd(), maybe_print_thread_hit_breakpoint(), mi_about_to_proceed(), mi_cmd_var_update_iter(), mi_on_normal_stop_1(), mi_on_resume(), mi_user_selected_context_changed(), normal_stop(), pop_dummy_frame(), post_create_inferior(), print_selected_thread_frame(), print_signal_received_reason(), print_stop_event(), print_stop_location(), print_thread_info_1(), proceed(), python_on_normal_stop(), queue_signal_command(), record_btrace_frame_sniffer(), record_btrace_set_replay(), record_btrace_tailcall_frame_sniffer(), record_full_goto_entry(), require_btrace_thread(), restore_infcall_control_state(), restore_infcall_suspend_state(), resume(), record_full_target::resume(), remote_target::resume(), resume_1(), run_command_1(), save_infcall_control_state(), save_infcall_suspend_state(), scoped_restore_current_thread::scoped_restore_current_thread(), set_longjmp_breakpoint_for_call_dummy(), set_momentary_breakpoint(), set_std_terminate_breakpoint(), signal_command(), step_1(), stop_context::stop_context(), record_btrace_target::stopped_by_hw_breakpoint(), remote_target::stopped_by_hw_breakpoint(), record_btrace_target::stopped_by_sw_breakpoint(), remote_target::stopped_by_sw_breakpoint(), remote_target::stopped_by_watchpoint(), remote_target::stopped_data_address(), thread_command(), thread_name_command(), thread_num_make_value_helper(), try_thread_db_load_1(), until_break_command(), until_next_command(), validate_registers_access(), varobj_create(), and watchpoint_in_thread_scope().

◆ inferior_thread_count_make_value()

static struct value * inferior_thread_count_make_value ( struct gdbarch gdbarch,
struct internalvar var,
void *  ignore 
)
static

◆ info_threads_command()

static void info_threads_command ( const char *  arg,
int  from_tty 
)
static

◆ info_threads_command_completer()

static void info_threads_command_completer ( struct cmd_list_element ignore,
completion_tracker tracker,
const char *  text,
const char *  word_ignored 
)
static

◆ init_thread_list()

void init_thread_list ( void  )

◆ is_current_thread()

static bool is_current_thread ( const thread_info thr)
static

Definition at line 77 of file thread.c.

References current_thread_.

Referenced by thread_info::deletable(), switch_to_thread(), and thread_try_catch_cmd().

◆ iterate_over_threads()

struct thread_info * iterate_over_threads ( int(*)(struct thread_info *, void *)  callback,
void *  data 
)

◆ live_threads_count()

static int live_threads_count ( void  )
static

Definition at line 595 of file thread.c.

References all_non_exited_threads().

Referenced by thread_apply_all_command().

◆ make_info_threads_options_def_group()

static gdb::option::option_def_group make_info_threads_options_def_group ( info_threads_opts it_opts)
inlinestatic

Definition at line 1254 of file thread.c.

References info_threads_option_defs.

Referenced by info_threads_command(), and info_threads_command_completer().

◆ make_thread_apply_all_options_def_group()

static std::array< gdb::option::option_def_group, 2 > make_thread_apply_all_options_def_group ( bool *  ascending,
qcs_flags flags 
)
inlinestatic

◆ make_thread_apply_options_def_group()

static gdb::option::option_def_group make_thread_apply_options_def_group ( qcs_flags flags)
inlinestatic

Definition at line 1563 of file thread.c.

References flags, and thr_qcs_flags_option_defs.

Referenced by thread_apply_command(), and thread_apply_command_completer().

◆ new_thread()

static struct thread_info * new_thread ( struct inferior inf,
ptid_t  ptid 
)
static

◆ 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,
const char *  requested_threads,
int  pid 
)

Definition at line 1226 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().

◆ print_thread_info_1()

static void print_thread_info_1 ( struct ui_out uiout,
const char *  requested_threads,
int  global_ids,
int  pid,
int  show_global_ids 
)
static

◆ prune_threads()

void prune_threads ( void  )

◆ push_thread_stack_temporary()

void push_thread_stack_temporary ( thread_info tp,
struct value v 
)

◆ set_executing()

void set_executing ( process_stratum_target targ,
ptid_t  ptid,
bool  executing 
)

◆ set_resumed()

void set_resumed ( process_stratum_target targ,
ptid_t  ptid,
bool  resumed 
)

Definition at line 819 of file thread.c.

References all_non_exited_threads().

Referenced by mark_non_executing_threads().

◆ set_running()

void set_running ( process_stratum_target targ,
ptid_t  ptid,
bool  running 
)

◆ set_running_thread()

static bool set_running_thread ( struct thread_info tp,
bool  running 
)
static

◆ set_stop_requested()

void set_stop_requested ( process_stratum_target targ,
ptid_t  ptid,
bool  stop 
)

◆ set_thread_exited()

void set_thread_exited ( thread_info tp,
bool  silent 
)

◆ should_print_thread()

static int should_print_thread ( const char *  requested_threads,
int  default_inf_num,
int  global_ids,
int  pid,
struct thread_info thr 
)
static

◆ show_debug_threads()

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

Definition at line 59 of file thread.c.

References gdb_printf().

◆ show_inferior_qualified_tids()

int show_inferior_qualified_tids ( void  )

Definition at line 1419 of file thread.c.

References inferior_list.

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

◆ show_print_thread_events()

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 1934 of file thread.c.

References gdb_printf().

◆ show_thread_that_caused_stop()

int show_thread_that_caused_stop ( void  )

Definition at line 1411 of file thread.c.

References highest_thread_num.

Referenced by maybe_print_thread_hit_breakpoint(), and print_signal_received_reason().

◆ switch_to_no_thread()

void switch_to_no_thread ( )

◆ switch_to_thread() [1/2]

void switch_to_thread ( process_stratum_target proc_target,
ptid_t  ptid 
)

Definition at line 1350 of file thread.c.

References find_thread_ptid(), and switch_to_thread().

◆ switch_to_thread() [2/2]

void switch_to_thread ( thread_info thr)

Definition at line 1335 of file thread.c.

References is_current_thread(), reinit_frame_cache(), and switch_to_thread_no_regs().

Referenced by add_to_thread_list(), gnu_nat_target::attach(), inf_ptrace_target::attach(), extended_remote_target::attach(), nto_procfs_target::attach(), attach_post_wait(), bsd_kvm_target_open(), btrace_compute_ftrace_bts(), btrace_fetch(), btrace_read_config(), check_thread_db_callback(), clean_up_just_stopped_threads_fsms(), gdbsim_target::close_one_inferior(), context_switch(), core_target_open(), gnu_nat_target::create_inferior(), go32_nat_target::create_inferior(), inf_ptrace_target::create_inferior(), nto_procfs_target::create_inferior(), procfs_target::create_inferior(), gdbsim_target::create_inferior(), detach_inferior_command(), displaced_step_finish(), displaced_step_prepare_throw(), do_attach(), windows_nat_target::do_initial_windows_stuff(), process_stratum_target::follow_exec(), follow_fork(), follow_fork_inferior(), get_thread_current_frame_id(), handle_inferior_event(), handle_no_resumed(), handle_vfork_child_exec_or_exit(), inferior_command(), darwin_nat_target::init_thread_list(), keep_going_stepped_thread(), kill_inferior_command(), kill_or_detach(), linux_get_siginfo_data(), mi_cmd_execute(), mi_cmd_remove_inferior(), mi_cmd_target_detach(), pdc_read_data(), remote_target::print_one_stopped_thread(), print_thread_info_1(), proceed(), proceed_after_attach(), proceed_after_vfork_done(), proceed_thread(), proceed_thread_callback(), ravenscar_inferior_created(), record_full_wait_1(), remote_new_objfile(), remote_target::remote_notice_new_inferior(), restart_after_all_stop_detach(), restart_threads(), scoped_restore_current_thread::restore(), run_one_inferior(), save_waitstatus(), ravenscar_thread_target::set_base_thread_from_ravenscar_task(), remote_target::start_remote_1(), start_step_over(), startup_inferior(), switch_back_to_stepped_thread(), switch_to_program_space_and_thread(), switch_to_thread(), switch_to_thread_if_alive(), task_command_1(), tfile_target_open(), thpy_switch(), and value_of_root_1().

◆ switch_to_thread_if_alive()

bool switch_to_thread_if_alive ( thread_info thr)

◆ switch_to_thread_no_regs()

void switch_to_thread_no_regs ( struct thread_info thread)

◆ taas_command()

static void taas_command ( const char *  cmd,
int  from_tty 
)
static

Definition at line 1788 of file thread.c.

References execute_command().

◆ tfaas_command()

static void tfaas_command ( const char *  cmd,
int  from_tty 
)
static

Definition at line 1799 of file thread.c.

References execute_command().

◆ thread_alive()

static bool thread_alive ( thread_info tp)
static

◆ thread_apply_all_command()

static void thread_apply_all_command ( const char *  cmd,
int  from_tty 
)
static

◆ thread_apply_all_command_completer()

static void thread_apply_all_command_completer ( cmd_list_element ignore,
completion_tracker tracker,
const char *  text,
const char *  word 
)
static

◆ thread_apply_command()

static void thread_apply_command ( const char *  tidlist,
int  from_tty 
)
static

◆ thread_apply_command_completer()

static void thread_apply_command_completer ( cmd_list_element ignore,
completion_tracker tracker,
const char *  text,
const char *   
)
static

◆ thread_cancel_execution_command()

void thread_cancel_execution_command ( struct thread_info thr)

◆ thread_change_ptid()

void thread_change_ptid ( process_stratum_target targ,
ptid_t  old_ptid,
ptid_t  new_ptid 
)

◆ thread_command()

void thread_command ( const char *  tidstr,
int  from_tty 
)

◆ thread_count()

int thread_count ( process_stratum_target proc_target)

◆ thread_find_command()

static void thread_find_command ( const char *  arg,
int  from_tty 
)
static

◆ 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_id_per_inf_num_make_value()

static struct value * thread_id_per_inf_num_make_value ( struct gdbarch gdbarch,
struct internalvar var,
void *  ignore 
)
static

Definition at line 2109 of file thread.c.

References thread_num_make_value_helper().

◆ thread_is_in_step_over_chain()

int thread_is_in_step_over_chain ( struct thread_info tp)

◆ thread_name()

const char * thread_name ( thread_info thread)

◆ thread_name_command()

static void thread_name_command ( const char *  arg,
int  from_tty 
)
static

Definition at line 1859 of file thread.c.

References inferior_ptid, and inferior_thread().

◆ thread_num_make_value_helper()

static struct value * thread_num_make_value_helper ( struct gdbarch gdbarch,
int  global 
)
static

◆ thread_select()

void thread_select ( const char *  tidstr,
thread_info tp 
)

◆ thread_stack_temporaries_enabled_p()

bool thread_stack_temporaries_enabled_p ( thread_info tp)

◆ thread_state_string()

const char * thread_state_string ( enum thread_state  state)

Definition at line 2064 of file thread.c.

References THREAD_EXITED, THREAD_RUNNING, and THREAD_STOPPED.

Referenced by call_function_by_hand_dummy(), and infrun_debug_show_threads().

◆ thread_step_over_chain_length()

int thread_step_over_chain_length ( const thread_step_over_list l)

Definition at line 410 of file thread.c.

Referenced by start_step_over().

◆ thread_target_id_str()

static std::string thread_target_id_str ( thread_info tp)
static

◆ thread_try_catch_cmd()

void thread_try_catch_cmd ( thread_info thr,
gdb::optional< int >  ada_task,
const char *  cmd,
int  from_tty,
const qcs_flags flags 
)

◆ threads_are_executing()

bool threads_are_executing ( process_stratum_target target)

Definition at line 897 of file thread.c.

References process_stratum_target::threads_executing.

Referenced by breakpoints_should_be_inserted_now().

◆ tp_array_compar_ascending()

static bool tp_array_compar_ascending ( const thread_info_ref a,
const thread_info_ref b 
)
static

Definition at line 1447 of file thread.c.

Referenced by thread_apply_all_command().

◆ tp_array_compar_descending()

static bool tp_array_compar_descending ( const thread_info_ref a,
const thread_info_ref b 
)
static

Definition at line 1460 of file thread.c.

Referenced by thread_apply_all_command().

◆ update_thread_list()

void update_thread_list ( void  )

◆ update_threads_executing()

static void update_threads_executing ( void  )
static

◆ valid_global_thread_id()

int valid_global_thread_id ( int  global_id)

Definition at line 602 of file thread.c.

References all_threads().

Referenced by bppy_set_thread(), gdbscm_set_breakpoint_thread_x(), and insert_breakpoint_locations().

◆ validate_registers_access()

void validate_registers_access ( void  )

◆ value_in_thread_stack_temporaries()

bool value_in_thread_stack_temporaries ( struct value val,
thread_info tp 
)

Variable Documentation

◆ ascending_option_def

const gdb::option::flag_option_def ascending_option_def
static
Initial value:
= {
"ascending",
N_("\
Call COMMAND for all threads in ascending order.\n\
The default is descending order."),
}

Definition at line 1516 of file thread.c.

Referenced by make_thread_apply_all_options_def_group().

◆ current_thread_

thread_info* current_thread_
static

◆ debug_threads

bool debug_threads = false

Definition at line 54 of file thread.c.

◆ gthread_funcs

const struct internalvar_funcs gthread_funcs
static
Initial value:
=
{
NULL,
}
static struct value * global_thread_id_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
Definition thread.c:2120

Definition at line 2155 of file thread.c.

◆ highest_thread_num

int highest_thread_num
static

◆ inferior_thread_count_funcs

const struct internalvar_funcs inferior_thread_count_funcs
static
Initial value:
=
{
NULL,
}
static struct value * inferior_thread_count_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
Definition thread.c:2131

Definition at line 2163 of file thread.c.

◆ info_threads_option_defs

const gdb::option::option_def info_threads_option_defs[]
static
Initial value:
= {
"gid",
[] (info_threads_opts *opts) { return &opts->show_global_ids; },
N_("Show global thread IDs."),
},
}

Definition at line 1240 of file thread.c.

Referenced by make_info_threads_options_def_group().

◆ print_thread_events

bool print_thread_events = true

◆ thr_qcs_flags_option_defs

const gdb::option::option_def thr_qcs_flags_option_defs[]
static
Initial value:
= {
"q", [] (qcs_flags *opt) { return &opt->quiet; },
N_("Disables printing the thread information."),
},
"c", [] (qcs_flags *opt) { return &opt->cont; },
N_("Print any error raised by COMMAND and continue."),
},
"s", [] (qcs_flags *opt) { return &opt->silent; },
N_("Silently ignore any errors or empty output produced by COMMAND."),
},
}

Definition at line 1529 of file thread.c.

Referenced by make_thread_apply_all_options_def_group(), and make_thread_apply_options_def_group().

◆ thread_cmd_list

struct cmd_list_element* thread_cmd_list = NULL

Definition at line 2143 of file thread.c.

Referenced by add_thread_commands().

◆ thread_funcs

const struct internalvar_funcs thread_funcs
static
Initial value:
=
{
NULL,
}
static struct value * thread_id_per_inf_num_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
Definition thread.c:2109

Definition at line 2147 of file thread.c.