21#if !defined (INFERIOR_H)
49#include "gdbsupport/environ.h"
55#include "gdbsupport/refcounted-object.h"
56#include "gdbsupport/forward-scope-exit.h"
57#include "gdbsupport/gdb_unique_ptr.h"
58#include "gdbsupport/intrusive_list.h"
60#include "gdbsupport/common-inferior.h"
66#include <unordered_map>
84 catch (
const gdb_exception_error &e)
90#if __cpp_lib_uncaught_exceptions
91 unwinding = std::uncaught_exceptions () > 0;
93 unwinding = std::uncaught_exception ();
96 warning (_(
"Failed to restore inferior state: %s"), e.what ());
102typedef std::unique_ptr<infcall_suspend_state, infcall_suspend_state_deleter>
118typedef std::unique_ptr<infcall_control_state, infcall_control_state_deleter>
142 const gdb_byte *buf);
148 const gdb_byte *buf);
246 struct value *function);
354 {
return !this->
filename.empty (); }
396class inferior :
public refcounted_object,
397 public intrusive_list_node<inferior>
404 bool deletable ()
const {
return refcount () == 0; }
517 void set_tty (std::string terminal_name);
518 const std::string &
tty ();
534 const std::string &
args ()
const
551 const std::string &
cwd ()
const
636 std::unique_ptr<private_inferior>
priv;
void delete_longjmp_breakpoint(int thread)
target_ops * top_target()
inferior_control_state control
target_desc_info tdesc_info
registry< inferior > registry_fields
void pop_all_targets_above(enum strata stratum)
thread_info * find_thread(ptid_t ptid)
int unpush_target(struct target_ops *t)
void set_args(std::string args)
target_terminal_state terminal_state
void unpush_target_and_assert(struct target_ops *target)
void do_all_continuations()
const std::string & cwd() const
symfile_add_flags symfile_flags
displaced_step_inferior_state displaced_step_state
std::unique_ptr< private_inferior > priv
std::unordered_map< ptid_t, thread_info * > ptid_thread_map
target_stack m_target_stack
safe_inf_threads_range threads_safe()
void push_target(struct target_ops *t)
struct process_stratum_target * process_target()
thread_info * thread_waiting_for_vfork_done
const std::string & args() const
void add_continuation(std::function< void()> &&cont)
struct address_space * aspace
void pop_all_targets_at_and_above(enum strata stratum)
const std::string & tty()
inf_non_exited_threads_range non_exited_threads()
target_ops * find_target_beneath(const target_ops *t)
void set_tty(std::string terminal_name)
inf_threads_range threads()
bool target_is_pushed(const target_ops *t) const
intrusive_list< thread_info > thread_list
bool in_initial_library_scan
std::list< std::function< void()> > m_continuations
void set_cwd(std::string cwd)
struct program_space * pspace
target_ops * target_at(enum strata stratum)
scoped_restore_current_inferior_for_memory(inferior *inf)
DISABLE_COPY_AND_ASSIGN(scoped_restore_current_inferior_for_memory)
scoped_restore_current_inferior m_save_inferior
scoped_restore_tmpl< ptid_t > m_save_ptid
scoped_restore_current_program_space m_save_progspace
scoped_restore_current_inferior()
DISABLE_COPY_AND_ASSIGN(scoped_restore_current_inferior)
~scoped_restore_current_inferior()
bool is_pushed(const target_ops *t) const
target_ops * at(strata stratum) const
target_ops * find_beneath(const target_ops *t) const
all_matching_threads_range all_threads(process_stratum_target *proc_target=nullptr, ptid_t filter_ptid=minus_one_ptid)
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
iterator_range< all_inferiors_safe_iterator > all_inferiors_safe_range
iterator_range< all_inferiors_iterator > all_inferiors_range
iterator_range< all_non_exited_inferiors_iterator > all_non_exited_inferiors_range
void discard_infcall_suspend_state(struct infcall_suspend_state *)
CORE_ADDR unsigned_pointer_to_address(struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
void inferior_appeared(struct inferior *inf, int pid)
void continue_1(int all_threads)
void restore_infcall_control_state(struct infcall_control_state *)
struct inferior * add_inferior_silent(int pid)
struct inferior * add_inferior_with_spaces(void)
void print_selected_inferior(struct ui_out *uiout)
void address_to_signed_pointer(struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
void attach_command(const char *, int)
void prepare_execution_command(struct target_ops *target, int background)
void exit_inferior(inferior *inf)
all_inferiors_safe_range all_inferiors_safe()
tribool is_gdb_terminal(const char *tty)
bool valid_global_inferior_id(int id)
void set_sigint_trap(void)
std::unique_ptr< infcall_control_state, infcall_control_state_deleter > infcall_control_state_up
void restore_infcall_suspend_state(struct infcall_suspend_state *)
void reopen_exec_file(void)
infcall_suspend_state_up save_infcall_suspend_state()
all_inferiors_range all_inferiors(process_stratum_target *proc_target=nullptr)
void child_terminal_ours(struct target_ops *self)
struct inferior * find_inferior_ptid(process_stratum_target *targ, ptid_t ptid)
void detach_command(const char *, int)
void discard_infcall_control_state(struct infcall_control_state *)
struct inferior * find_inferior_pid(process_stratum_target *targ, int pid)
void child_terminal_init(struct target_ops *self)
void child_terminal_info(struct target_ops *self, const char *, int)
infcall_control_state_up save_infcall_control_state()
ptid_t gdb_startup_inferior(pid_t pid, int num_traps)
CORE_ADDR signed_pointer_to_address(struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
int number_of_inferiors(void)
@ STOP_QUIETLY_NO_SIGSTOP
void registers_info(const char *, int)
gdb::optional< scoped_restore_current_thread > maybe_switch_inferior(inferior *inf)
void child_pass_ctrlc(struct target_ops *self)
bool print_inferior_events
void set_current_inferior(inferior *)
void child_terminal_ours_for_output(struct target_ops *self)
readonly_detached_regcache * get_infcall_suspend_state_regcache(struct infcall_suspend_state *)
void detach_inferior(inferior *inf)
void interrupt_target_1(bool all_threads)
int have_live_inferiors(void)
void switch_to_inferior_and_push_target(inferior *new_inf, bool no_connection, inferior *org_inf)
void c_c_handler_ftype(int)
void child_interrupt(struct target_ops *self)
void generic_mourn_inferior(void)
inferior * current_inferior()
struct value * get_return_value(struct symbol *func_symbol, struct value *function)
void notice_new_inferior(struct thread_info *, bool, int)
int stopped_by_random_signal
void child_terminal_inferior(struct target_ops *self)
FORWARD_SCOPE_EXIT(delete_longjmp_breakpoint) delete_longjmp_breakpoint_cleanup
struct inferior * add_inferior(int pid)
struct inferior * find_inferior_for_program_space(struct program_space *pspace)
void switch_to_inferior_no_thread(inferior *inf)
void setup_inferior(int from_tty)
void child_terminal_save_inferior(struct target_ops *self)
enum stop_stack_kind stop_stack_dummy
std::unique_ptr< infcall_suspend_state, infcall_suspend_state_deleter > infcall_suspend_state_up
void default_print_float_info(struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, const char *args)
void post_create_inferior(int from_tty)
void prune_inferiors(void)
void clear_sigint_trap(void)
c_c_handler_ftype * install_sigint_handler(c_c_handler_ftype *fn)
intrusive_list< inferior > inferior_list
int number_of_live_inferiors(process_stratum_target *proc_target)
all_non_exited_inferiors_range all_non_exited_inferiors(process_stratum_target *proc_target=nullptr)
void default_print_registers_info(struct gdbarch *gdbarch, struct ui_file *file, frame_info_ptr frame, int regnum, int all)
tribool sharing_input_terminal(int pid)
struct inferior * find_inferior_id(int num)
void unsigned_address_to_pointer(struct gdbarch *gdbarch, struct type *type, gdb_byte *buf, CORE_ADDR addr)
void delete_inferior(struct inferior *todel)
void set_current_program_space(struct program_space *pspace)
void operator()(struct infcall_control_state *state) const
void operator()(struct infcall_suspend_state *state) const
virtual ~private_inferior()=0
const struct target_desc * tdesc
bool target_has_execution(inferior *inf)
std::unique_ptr< target_ops, target_ops_deleter > target_ops_up
iterator_range< safe_inf_threads_iterator > safe_inf_threads_range
iterator_range< inf_non_exited_threads_iterator > inf_non_exited_threads_range
iterator_range< inf_threads_iterator > inf_threads_range