27#include "gdbsupport/environ.h"
44#include "gdbsupport/gdb_regex.h"
49#include "gdbsupport/gdb_optional.h"
156 return (ss_bps != NULL
202 if (exit_code.has_value ())
205 pulongest (*exit_code));
235 if (proc_target !=
nullptr)
252 gdb_assert (nr_deleted == 1);
262 inf->clear_thread_list ();
274 inf->num, ptid.to_string ().c_str ());
276 inf->thread_list.push_back (*tp);
279 gdb_assert (
inf->ptid_thread_map.find (ptid) ==
inf->ptid_thread_map.end ());
281 inf->ptid_thread_map[ptid] = tp;
298 gdb_assert (targ !=
nullptr);
303 inf->num, ptid.to_string ().c_str (),
326 result->
priv = std::move (priv);
344 : ptid (ptid_),
inf (inf_)
346 gdb_assert (inf_ != NULL);
447 for (
const thread_info &thread ATTRIBUTE_UNUSED : l)
459 tp->
ptid.to_string ().c_str ());
479 tp->
ptid.to_string ().c_str ());
492 gdb_assert (thr !=
nullptr);
495 thr->
ptid.to_string ().c_str (),
496 (exit_code.has_value ()
497 ? pulongest (*exit_code)
542 if (tp->global_num == global_id)
552 if (tp->per_inf_num == thr_num)
588 if ((*callback) (tp, data))
608 return std::distance (rng.begin (), rng.end ());
617 return std::distance (rng.begin (), rng.end ());
624 if (tp->global_num == global_id)
641 if (
inf->thread_list.empty ())
644 return &
inf->thread_list.front ();
650 gdb_assert (
inf->
pid != 0);
668 gdb_assert (
inf != NULL &&
inf->
pid != 0);
685 if (!tp->executing ())
801 struct value *lastval = NULL;
803 gdb_assert (tp != NULL);
812 ptid_t old_ptid, ptid_t new_ptid)
821 inf->
pid = new_ptid.pid ();
823 tp =
inf->find_thread (old_ptid);
824 gdb_assert (tp !=
nullptr);
826 int num_erased =
inf->ptid_thread_map.erase (old_ptid);
827 gdb_assert (num_erased == 1);
830 inf->ptid_thread_map[new_ptid] = tp;
850 bool started =
false;
857 tp->
ptid.to_string ().c_str (), running,
858 (started ?
" (started)" :
""));
897 bool any_started =
false;
911 tp->set_executing (executing);
918 else if (minus_one_ptid == ptid)
934 tp->stop_requested = stop;
945 bool any_started =
false;
962 error (_(
"No thread selected."));
968 error (_(
"The current thread has terminated"));
976 error (_(
"Selected thread is running."));
1003 && pc < thread->control.step_range_end);
1020 if (requested_threads != NULL && *requested_threads !=
'\0')
1035 if (requested_threads != NULL && *requested_threads !=
'\0')
1036 error (_(
"Requested thread not found in requested process"));
1056 if (extra_info !=
nullptr &&
name !=
nullptr)
1057 return string_printf (
"%s \"%s\" (%s)", target_id.c_str (),
name,
1059 else if (extra_info !=
nullptr)
1060 return string_printf (
"%s (%s)", target_id.c_str (), extra_info);
1061 else if (
name !=
nullptr)
1062 return string_printf (
"%s \"%s\"", target_id.c_str (),
name);
1073 int global_ids,
int pid,
1074 int show_global_ids)
1081 bool any_thread =
false;
1083 bool current_exited =
false;
1092 gdb::optional<ui_out_emit_list> list_emitter;
1093 gdb::optional<ui_out_emit_table> table_emitter;
1099 list_emitter.emplace (uiout,
"threads");
1105 size_t target_id_col_width = 17;
1110 global_ids,
pid, tp))
1118 = std::max (target_id_col_width,
1126 if (requested_threads == NULL || *requested_threads ==
'\0')
1127 uiout->
message (_(
"No threads.\n"));
1129 uiout->
message (_(
"No threads match '%s'.\n"),
1134 table_emitter.emplace (uiout, show_global_ids ? 5 : 4,
1135 n_threads,
"threads");
1139 if (show_global_ids)
1142 "target-id",
"Target Id");
1154 current_exited =
true;
1157 global_ids,
pid, tp))
1164 if (tp == current_thread)
1190 if (extra_info !=
nullptr)
1203 uiout->
text (
"(running)\n");
1216 const char *state =
"stopped";
1233 if (
pid == -1 && requested_threads == NULL)
1240The current thread <Thread ID %s> has terminated. See `help thread'.\n",
1244No selected thread. See `help thread'.\n");
1270 N_(
"Show global thread IDs."),
1307 const char *text,
const char *word_ignored)
1330 gdb_assert (thread !=
nullptr);
1362 gdb_assert (thr != NULL);
1435 : m_dont_restore (
std::move (rhs.m_dont_restore)),
1436 m_thread (
std::move (rhs.m_thread)),
1437 m_inf (
std::move (rhs.m_inf)),
1438 m_selected_frame_id (
std::move (rhs.m_selected_frame_id)),
1439 m_selected_frame_level (
std::move (rhs.m_selected_frame_level)),
1440 m_was_stopped (
std::move (rhs.m_was_stopped)),
1441 m_lang (
std::move (rhs.m_lang))
1444 rhs.m_dont_restore =
true;
1475 char *s = get_print_cell ();
1477 gdb_assert (thr !=
nullptr);
1478 xsnprintf (s, PRINT_CELL_SIZE,
"%d", thr->
per_inf_num);
1487 char *s = get_print_cell ();
1489 gdb_assert (thr !=
nullptr);
1501 if (a->inf->num != b->inf->num)
1502 return a->inf->num < b->inf->num;
1504 return (a->per_inf_num < b->per_inf_num);
1514 if (a->inf->num != b->inf->num)
1515 return a->inf->num > b->inf->num;
1517 return (a->per_inf_num > b->per_inf_num);
1524 const char *cmd,
int from_tty,
1532 std::string thr_header;
1533 if (ada_task.has_value ())
1534 thr_header = string_printf (_(
"\nTask ID %d:\n"), *ada_task);
1536 thr_header = string_printf (_(
"\nThread %s (%s):\n"),
1542 std::string cmd_result;
1544 (cmd_result, cmd, from_tty,
gdb_stdout->term_out ());
1545 if (!
flags.silent || cmd_result.length () > 0)
1552 catch (
const gdb_exception_error &ex)
1571Call COMMAND for all threads in ascending order.\n\
1572The default is descending order."),
1583 "q", [] (
qcs_flags *opt) {
return &opt->quiet; },
1584 N_(
"Disables printing the thread information."),
1588 "c", [] (
qcs_flags *opt) {
return &opt->cont; },
1589 N_(
"Print any error raised by COMMAND and continue."),
1593 "s", [] (
qcs_flags *opt) {
return &opt->silent; },
1594 N_(
"Silently ignore any errors or empty output produced by COMMAND."),
1601static inline std::array<gdb::option::option_def_group, 2>
1631 bool ascending =
false;
1641 if (cmd == NULL || *cmd ==
'\000')
1642 error (_(
"Please specify a command at the end of 'thread apply all'"));
1654 std::vector<thread_info_ref> thr_list_cpy;
1655 thr_list_cpy.reserve (tc);
1658 thr_list_cpy.push_back (thread_info_ref::new_reference (tp));
1659 gdb_assert (thr_list_cpy.size () == tc);
1661 auto *sorter = (ascending
1664 std::sort (thr_list_cpy.begin (), thr_list_cpy.end (), sorter);
1679 const char *text,
const char * )
1692 int inf_num, thr_start, thr_end;
1701 catch (
const gdb_exception_error &ex)
1708 const char *cmd = parser.
cur_tok ();
1718 && cmd > text && !isspace (cmd[-1]))
1738 const char *text,
const char *word)
1755 const char *cmd = NULL;
1758 if (tidlist == NULL || *tidlist ==
'\000')
1759 error (_(
"Please specify a thread ID list"));
1764 int inf_num, thr_start, thr_end;
1779 error (_(
"Please specify a command following the thread ID list"));
1781 if (tidlist == cmd || isdigit (cmd[0]))
1791 int inf_num, thr_num;
1793 parser.
get_tid (&inf_num, &thr_num);
1802 warning (_(
"Unknown inferior %d"), inf_num);
1809 if (thr_num >=
inf->highest_thread_num)
1820 warning (_(
"Unknown thread %d.%d"), inf_num, thr_num);
1822 warning (_(
"Unknown thread %d"), thr_num);
1842 if (cmd == NULL || *cmd ==
'\0')
1843 error (_(
"Please specify a command to apply on all threads"));
1844 std::string expanded = std::string (
"thread apply all -s ") + cmd;
1853 if (cmd == NULL || *cmd ==
'\0')
1854 error (_(
"Please specify a command to apply on all frames of all threads"));
1855 std::string expanded
1856 = std::string (
"thread apply all -s -- frame apply all -s ") + cmd;
1868 error (_(
"No thread selected"));
1875 gdb_printf (_(
"[Current thread is %s (%s) (exited)]\n"),
1879 gdb_printf (_(
"[Current thread is %s (%s)]\n"),
1884 error (_(
"No stack."));
1914 error (_(
"No thread selected"));
1916 arg = skip_spaces (arg);
1919 info->set_name (arg !=
nullptr ? make_unique_xstrdup (arg) :
nullptr);
1928 unsigned long match = 0;
1930 if (arg == NULL || *arg ==
'\0')
1931 error (_(
"Command requires an argument."));
1935 error (_(
"Invalid regexp (%s): %s"), tmp, arg);
1946 if (tp->name () !=
nullptr && re_exec (tp->name ()))
1954 if (tmp != NULL && re_exec (tmp))
1956 gdb_printf (_(
"Thread %s has target name '%s'\n"),
1962 if (!
name.empty () && re_exec (
name.c_str ()))
1964 gdb_printf (_(
"Thread %s has target id '%s'\n"),
1970 if (tmp != NULL && re_exec (tmp))
1972 gdb_printf (_(
"Thread %s has extra info '%s'\n"),
1978 gdb_printf (_(
"No threads match '%s'\n"), arg);
1988 _(
"Printing of thread events is %s.\n"),
1998 error (_(
"Thread ID %s has terminated."), tidstr);
2011 user_selected_what selection)
2024 uiout->
text (
"[Switching to thread ");
2035 uiout->
text (
"(running)\n");
2064 if (!
inf->has_execution ())
2069 if (
inf->thread_list.empty ())
2077 if (tp->executing ())
2099 const char *
name = thread->
name ();
2100 if (
name !=
nullptr)
2128 gdb_assert_not_reached (
"unknown thread state");
2230 static std::string info_threads_help
2232Display currently known threads.\n\
2233Usage: info threads [OPTION]... [ID]...\n\
2234If ID is given, it is a space-separated list of IDs of threads to display.\n\
2235Otherwise, all threads are displayed.\n\
2246Use this command to switch between threads.\n\
2247The new thread ID must be currently known."),
2252#define THREAD_APPLY_OPTION_HELP "\
2253Prints per-inferior thread number and target system's thread id\n\
2254followed by COMMAND output.\n\
2256By default, an error raised during the execution of COMMAND\n\
2257aborts \"thread apply\".\n\
2265Apply a command to a list of threads.\n\
2266Usage: thread apply ID... [OPTION]... COMMAND\n\
2267ID is a space-separated list of IDs of threads to apply COMMAND on.\n"
2272 thread_apply_help.c_str (),
2273 &thread_apply_list, 1,
2277 const auto thread_apply_all_opts
2281Apply a command to all threads.\n\
2283Usage: thread apply all [OPTION]... COMMAND\n"
2285 thread_apply_all_opts);
2288 thread_apply_all_help.c_str (),
2289 &thread_apply_list);
2293Apply a command to all threads (ignoring errors and empty output).\n\
2294Usage: taas [OPTION]... COMMAND\n\
2295shortcut for 'thread apply all -s [OPTION]... COMMAND'\n\
2296See \"help thread apply all\" for available options."));
2300Apply a command to all frames of all threads (ignoring errors and empty output).\n\
2301Usage: tfaas [OPTION]... COMMAND\n\
2302shortcut for 'thread apply all -s -- frame apply all -s [OPTION]... COMMAND'\n\
2303See \"help frame apply all\" for available options."));
2307 _(
"Set the current thread's name.\n\
2308Usage: thread name [NAME]\n\
2309If NAME is not given, then any existing name is removed."), &
thread_cmd_list);
2312Find threads that match a regular expression.\n\
2313Usage: thread find REGEXP\n\
2314Will display thread ids whose name, target ID, or extra info matches REGEXP."),
2319Set printing of thread events (such as thread start and exit)."), _(
"\
2320Show printing of thread events (such as thread start and exit)."), NULL,
2326Set thread debugging."), _(
"\
2327Show thread debugging."), _(
"\
2328When on messages about thread creation and deletion are printed."),
void annotate_new_thread(void)
void annotate_thread_changed(void)
void delete_breakpoint(struct breakpoint *bpt)
void bpstat_clear(bpstat **bsp)
int breakpoint_has_location_inserted_here(struct breakpoint *bp, const address_space *aspace, CORE_ADDR pc)
void delete_longjmp_breakpoint_at_next_stop(int thread)
void btrace_teardown(struct thread_info *tp)
void add_completion(gdb::unique_xmalloc_ptr< char > name, completion_match_for_lcd *match_for_lcd=NULL, const char *text=NULL, const char *word=NULL)
void advance_custom_word_point_by(int len)
void set_use_custom_word_point(bool enable)
std::unordered_map< ptid_t, thread_info * > ptid_thread_map
struct process_stratum_target * process_target()
inf_non_exited_threads_range non_exited_threads()
intrusive_list< thread_info > thread_list
thread_info * find_thread(ptid_t ptid)
void maybe_remove_resumed_with_pending_wait_status(thread_info *thread)
void maybe_add_resumed_with_pending_wait_status(thread_info *thread)
int m_selected_frame_level
~scoped_restore_current_thread()
scoped_restore_current_thread()
frame_id m_selected_frame_id
thread_info(inferior *inf, ptid_t ptid)
void set_pending_waitstatus(const target_waitstatus &ws)
thread_suspend_state m_suspend
std::vector< struct value * > stack_temporaries
void set_resumed(bool resumed)
std::unique_ptr< struct thread_fsm > release_thread_fsm()
intrusive_list_node< thread_info > step_over_list_node
void set_running(bool running)
void set_executing(bool executing)
bool has_pending_waitstatus() const
void clear_pending_waitstatus()
struct target_waitstatus pending_follow
private_thread_info_up priv
struct thread_fsm * thread_fsm() const
bool stack_temporaries_enabled
const char * name() const
thread_control_state control
const char * cur_tok() const
bool in_thread_range() const
bool tid_is_qualified() const
bool get_tid_range(int *inf_num, int *thr_start, int *thr_end)
void init(const char *tidlist, int default_inferior)
bool get_tid(int *inf_num, int *thr_num)
bool in_star_range() const
void field_string(const char *fldname, const char *string, const ui_file_style &style=ui_file_style())
void field_signed(const char *fldname, LONGEST value)
void field_skip(const char *fldname)
void text(const char *string)
void table_header(int width, ui_align align, const std::string &col_name, const std::string &col_hdr)
bool is_mi_like_p() const
void message(const char *format,...) ATTRIBUTE_PRINTF(2
struct cmd_list_element * showprintlist
struct cmd_list_element * cmdlist
struct cmd_list_element * setprintlist
struct cmd_list_element * showdebuglist
struct cmd_list_element * setdebuglist
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
void set_cmd_completer_handle_brkchars(struct cmd_list_element *cmd, completer_handle_brkchars_ftype *func)
cmd_list_element * add_com_alias(const char *name, cmd_list_element *target, command_class theclass, int abbrev_flag)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
struct cmd_list_element * add_prefix_cmd(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc, struct cmd_list_element **subcommands, int allow_unknown, struct cmd_list_element **list)
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
struct cmd_list_element * add_info(const char *name, cmd_simple_func_ftype *fun, const char *doc)
int number_is_in_list(const char *list, int number)
void validate_flags_qcs(const char *which_command, qcs_flags *flags)
void complete_nested_command_line(completion_tracker &tracker, const char *text)
EXTERN_C char * re_comp(const char *)
void restore_selected_frame(frame_id frame_id, int frame_level) noexcept
void reinit_frame_cache(void)
void save_selected_frame(frame_id *frame_id, int *frame_level) noexcept
frame_info_ptr get_selected_frame(const char *message)
void print_stack_frame(frame_info_ptr, int print_level, enum print_what print_what, int set_current_sal)
void print_stack_frame_to_uiout(struct ui_out *uiout, frame_info_ptr, int print_level, enum print_what print_what, int set_current_sal)
void execute_command_to_string(std::string &res, const char *p, int from_tty, bool term_out)
void execute_command(const char *, int)
all_threads_safe_range all_threads_safe()
all_matching_threads_range all_threads(process_stratum_target *proc_target=nullptr, ptid_t filter_ptid=minus_one_ptid)
all_non_exited_threads_range all_non_exited_threads(process_stratum_target *proc_target=nullptr, ptid_t filter_ptid=minus_one_ptid)
struct thread_info * inferior_thread(void)
void switch_to_thread(struct thread_info *thr)
std::unique_ptr< private_thread_info > private_thread_info_up
#define threads_debug_printf(fmt,...)
gdb::ref_ptr< struct thread_info, refcounted_object_ref_policy > thread_info_ref
intrusive_list< thread_info, thread_step_over_list_node > thread_step_over_list
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
struct inferior * find_inferior_ptid(process_stratum_target *targ, ptid_t ptid)
void set_current_inferior(struct inferior *inf)
struct inferior * current_inferior(void)
void switch_to_inferior_no_thread(inferior *inf)
intrusive_list< inferior > inferior_list
struct inferior * find_inferior_id(int num)
all_inferiors_range all_inferiors(process_stratum_target *proc_target=nullptr)
all_non_exited_inferiors_range all_non_exited_inferiors(process_stratum_target *proc_target=nullptr)
void notify_user_selected_context_changed(user_selected_what selection)
thread_step_over_list global_thread_step_over_list
#define infrun_debug_printf(fmt,...)
void clear_inline_frame_state(process_stratum_target *target, ptid_t filter_ptid)
void interps_notify_thread_exited(thread_info *t, gdb::optional< ULONGEST > exit_code, int silent)
void interps_notify_target_resumed(ptid_t ptid)
void interps_notify_new_thread(thread_info *t)
static void set_language(const char *language)
const struct language_defn * current_language
observable< ptid_t > thread_stop_requested
observable< struct thread_info * > new_thread
observable< process_stratum_target *, ptid_t, ptid_t > thread_ptid_changed
observable< ptid_t > target_resumed
observable< thread_info *, gdb::optional< ULONGEST >, bool > thread_exit
bool process_options(const char **args, process_options_mode mode, gdb::array_view< const option_def_group > options_group)
@ PROCESS_OPTIONS_UNKNOWN_IS_ERROR
@ PROCESS_OPTIONS_UNKNOWN_IS_OPERAND
std::string build_help(const char *help_tmpl, gdb::array_view< const option_def_group > options_group)
void complete_on_all_options(completion_tracker &tracker, gdb::array_view< const option_def_group > options_group)
bool complete_options(completion_tracker &tracker, const char **args, process_options_mode mode, gdb::array_view< const option_def_group > options_group)
void set_current_program_space(struct program_space *pspace)
void frame_apply_all_cmd_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
const option_def & def() const
enum language la_language
virtual ~private_thread_info()=0
const char * shortname() const
target_waitstatus & set_spurious()
CORE_ADDR step_range_start
struct breakpoint * exception_resume_breakpoint
struct breakpoint * step_resume_breakpoint
struct breakpoint * single_step_breakpoints
struct target_waitstatus waitstatus
int target_core_of_thread(ptid_t ptid)
void target_update_thread_list(void)
struct thread_info * target_thread_handle_to_thread_info(const gdb_byte *thread_handle, int handle_len, struct inferior *inf)
int target_has_registers()
const char * target_thread_name(struct thread_info *info)
const char * target_extra_thread_info(thread_info *tp)
std::string target_pid_to_str(ptid_t ptid)
int target_thread_alive(ptid_t ptid)
void switch_to_thread(thread_info *thr)
void delete_exception_resume_breakpoint(struct thread_info *tp)
thread_info * any_thread_of_inferior(inferior *inf)
static thread_info * current_thread_
static const gdb::option::flag_option_def ascending_option_def
static bool set_running_thread(struct thread_info *tp, bool running)
bool switch_to_thread_if_alive(thread_info *thr)
static void notify_new_thread(thread_info *t)
int thread_step_over_chain_length(const thread_step_over_list &l)
struct thread_info * add_thread(process_stratum_target *targ, ptid_t ptid)
static const gdb::option::option_def thr_qcs_flags_option_defs[]
const char * thread_state_string(enum thread_state state)
static void tfaas_command(const char *cmd, int from_tty)
void global_thread_step_over_chain_enqueue_chain(thread_step_over_list &&list)
static void thread_apply_all_command_completer(cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word)
int thread_count(process_stratum_target *proc_target)
void global_thread_step_over_chain_enqueue(struct thread_info *tp)
struct cmd_list_element * thread_cmd_list
bool threads_are_executing(process_stratum_target *target)
struct thread_info * add_thread_silent(process_stratum_target *targ, ptid_t ptid)
static bool is_current_thread(const thread_info *thr)
thread_info * first_thread_of_inferior(inferior *inf)
static const struct internalvar_funcs gthread_funcs
void delete_step_resume_breakpoint(struct thread_info *tp)
void print_selected_thread_frame(struct ui_out *uiout, user_selected_what selection)
void push_thread_stack_temporary(thread_info *tp, struct value *v)
void delete_thread(thread_info *thread)
void switch_to_thread_no_regs(struct thread_info *thread)
static bool tp_array_compar_descending(const thread_info_ref &a, const thread_info_ref &b)
int show_inferior_qualified_tids(void)
static void delete_thread_1(thread_info *thr, gdb::optional< ULONGEST > exit_code, bool silent)
void validate_registers_access(void)
static void info_threads_command(const char *arg, int from_tty)
static struct value * thread_num_make_value_helper(struct gdbarch *gdbarch, int global)
static bool should_print_thread(const char *requested_threads, int default_inf_num, int global_ids, int pid, struct thread_info *thr)
bool value_in_thread_stack_temporaries(struct value *val, thread_info *tp)
static void thread_apply_command(const char *tidlist, int from_tty)
static void show_print_thread_events(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
int valid_global_thread_id(int global_id)
static std::array< gdb::option::option_def_group, 2 > make_thread_apply_all_options_def_group(bool *ascending, qcs_flags *flags)
static void update_threads_executing(void)
bool can_access_registers_thread(thread_info *thread)
int show_thread_that_caused_stop(void)
bool pc_in_thread_step_range(CORE_ADDR pc, struct thread_info *thread)
static void info_threads_command_completer(struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word_ignored)
value * get_last_thread_stack_temporary(thread_info *tp)
static void notify_target_resumed(ptid_t ptid)
static struct value * thread_id_per_inf_num_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
static bool tp_array_compar_ascending(const thread_info_ref &a, const thread_info_ref &b)
static void show_debug_threads(struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
void set_stop_requested(process_stratum_target *targ, ptid_t ptid, bool stop)
struct thread_info * iterate_over_threads(int(*callback)(struct thread_info *, void *), void *data)
struct thread_info * find_thread_global_id(int global_id)
static void taas_command(const char *cmd, int from_tty)
const char * print_full_thread_id(struct thread_info *thr)
void finish_thread_state(process_stratum_target *targ, ptid_t ptid)
thread_info * any_live_thread_of_inferior(inferior *inf)
static void thread_apply_command_completer(cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *)
void set_thread_exited(thread_info *tp, gdb::optional< ULONGEST > exit_code, bool silent)
void update_thread_list(void)
void set_executing(process_stratum_target *targ, ptid_t ptid, bool executing)
struct thread_info * inferior_thread(void)
static gdb::option::option_def_group make_thread_apply_options_def_group(qcs_flags *flags)
void thread_command(const char *tidstr, int from_tty)
static void delete_thread_breakpoint(struct breakpoint **bp_p)
static void thread_find_command(const char *arg, int from_tty)
void thread_try_catch_cmd(thread_info *thr, gdb::optional< int > ada_task, const char *cmd, int from_tty, const qcs_flags &flags)
void set_running(process_stratum_target *targ, ptid_t ptid, bool running)
int thread_has_single_step_breakpoint_here(struct thread_info *tp, const address_space *aspace, CORE_ADDR addr)
bool thread_stack_temporaries_enabled_p(thread_info *tp)
static int highest_thread_num
void global_thread_step_over_chain_remove(struct thread_info *tp)
void delete_thread_with_exit_code(thread_info *thread, ULONGEST exit_code, bool silent)
static std::string thread_target_id_str(thread_info *tp)
static void notify_thread_exited(thread_info *t, gdb::optional< ULONGEST > exit_code, int silent)
static struct thread_info * new_thread(struct inferior *inf, ptid_t ptid)
void thread_change_ptid(process_stratum_target *targ, ptid_t old_ptid, ptid_t new_ptid)
static int live_threads_count(void)
static void delete_at_next_stop(struct breakpoint **bp)
void set_resumed(process_stratum_target *targ, ptid_t ptid, bool resumed)
static struct value * inferior_thread_count_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
static void thread_apply_all_command(const char *cmd, int from_tty)
int thread_has_single_step_breakpoints_set(struct thread_info *tp)
const char * thread_name(thread_info *thread)
int thread_is_in_step_over_chain(struct thread_info *tp)
static const gdb::option::option_def info_threads_option_defs[]
static bool thread_alive(thread_info *tp)
#define THREAD_APPLY_OPTION_HELP
struct thread_info * find_thread_by_handle(gdb::array_view< const gdb_byte > handle, struct inferior *inf)
void _initialize_thread()
static void thread_name_command(const char *arg, int from_tty)
static void print_thread_info_1(struct ui_out *uiout, const char *requested_threads, int global_ids, int pid, int show_global_ids)
struct thread_info * add_thread_with_info(process_stratum_target *targ, ptid_t ptid, private_thread_info_up priv)
void delete_single_step_breakpoints(struct thread_info *tp)
static void clear_thread_inferior_resources(struct thread_info *tp)
bool in_thread_list(process_stratum_target *targ, ptid_t ptid)
void switch_to_no_thread()
void print_thread_info(struct ui_out *uiout, const char *requested_threads, int pid)
void thread_cancel_execution_command(struct thread_info *thr)
const char * print_thread_id(struct thread_info *thr)
void thread_select(const char *tidstr, thread_info *tp)
static struct thread_info * find_thread_id(struct inferior *inf, int thr_num)
void delete_exited_threads(void)
void delete_thread_silent(thread_info *thread)
static const struct internalvar_funcs thread_funcs
static struct value * global_thread_id_make_value(struct gdbarch *gdbarch, struct internalvar *var, void *ignore)
static gdb::option::option_def_group make_info_threads_options_def_group(info_threads_opts *it_opts)
static const struct internalvar_funcs inferior_thread_count_funcs
void init_thread_list(void)
struct thread_info * parse_thread_id(const char *tidstr, const char **end)
int tid_is_in_list(const char *list, int default_inferior, int inf_num, int thr_num)
void ATTRIBUTE_NORETURN invalid_thread_id_error(const char *string)
void gdb_printf(struct ui_file *stream, const char *format,...)
struct internalvar * create_internalvar_type_lazy(const char *name, const struct internalvar_funcs *funcs, void *data)
struct value * value_from_longest(struct type *type, LONGEST num)