Lines Matching defs:inferior
21 #include "inferior.h"
42 intrusive_list<inferior> inferior_list;
45 /* See inferior.h. */
48 /* The Current Inferior. This is a strong reference. I.e., whenever
49 an inferior is the current inferior, its refcount is
53 struct inferior*
60 set_current_inferior (struct inferior *inf)
62 /* There's always an inferior. */
70 inferior::~inferior ()
72 /* Before the inferior is deleted, all target_ops should be popped from
84 inferior::inferior (int pid_)
92 /* See inferior.h. */
95 inferior::unpush_target (struct target_ops *t)
97 /* If unpushing the process stratum target from the inferior while threads
98 exist in the inferior, ensure that we don't leave any threads of the
99 inferior in the target's "resumed with pending wait status" list.
113 /* See inferior.h. */
116 inferior::unpush_target_and_assert (struct target_ops *target)
125 /* See inferior.h. */
128 inferior::pop_all_targets_above (enum strata stratum)
132 temporarily switch inferior now. */
140 /* See inferior.h. */
143 inferior::pop_all_targets_at_and_above (enum strata stratum)
147 temporarily switch inferior now. */
156 inferior::set_tty (std::string terminal_name)
162 inferior::tty ()
167 /* See inferior.h. */
170 inferior::set_args (gdb::array_view<char * const> args)
176 inferior::set_arch (gdbarch *arch)
188 inferior::add_continuation (std::function<void ()> &&cont)
194 inferior::do_all_continuations ()
204 /* Notify interpreters and observers that inferior INF was added. */
207 notify_inferior_added (inferior *inf)
213 struct inferior *
216 inferior *inf = new inferior (pid);
228 struct inferior *
231 struct inferior *inf = add_inferior_silent (pid);
236 gdb_printf (_("[New inferior %d (%s)]\n"),
240 gdb_printf (_("[New inferior %d]\n"), inf->num);
246 /* See inferior.h. */
249 inferior::find_thread (ptid_t ptid)
258 /* See inferior.h. */
261 inferior::clear_thread_list ()
274 /* Notify interpreters and observers that inferior INF was removed. */
277 notify_inferior_removed (inferior *inf)
284 delete_inferior (struct inferior *inf)
293 /* Pop all targets now, this ensures that inferior::unpush is called
295 inferior INF then we need to make this call before we delete the
306 /* Notify interpreters and observers that inferior INF disappeared. */
309 notify_inferior_disappeared (inferior *inf)
315 /* See inferior.h. */
318 exit_inferior (struct inferior *inf)
348 /* See inferior.h. */
351 detach_inferior (inferior *inf)
359 gdb_printf (_("[Inferior %d (%s) detached]\n"),
364 /* Notify interpreters and observers that inferior INF appeared. */
367 notify_inferior_appeared (inferior *inf)
374 inferior_appeared (struct inferior *inf, int pid)
376 /* If this is the first inferior with threads, reset the global
389 struct inferior *
392 for (inferior *inf : all_inferiors ())
399 struct inferior *
402 /* Looking for inferior pid == 0 is always wrong, and indicative of
407 for (inferior *inf : all_inferiors (targ))
414 /* See inferior.h */
416 struct inferior *
422 /* See inferior.h. */
424 struct inferior *
427 struct inferior *cur_inf = current_inferior ();
432 for (inferior *inf : all_inferiors ())
442 for (inferior *inf ATTRIBUTE_UNUSED : all_non_exited_inferiors ())
449 where an inferior might have a non-zero pid but no threads, as
457 for (inferior *inf : all_non_exited_inferiors (proc_target))
461 /* Found a live thread in this inferior, go to the next
462 inferior. */
470 /* Return true if there is at least one live inferior. */
484 for (inferior *inf : all_inferiors_safe ())
504 /* Converts an inferior process id to a string. Like
516 /* See inferior.h. */
521 struct inferior *inf = current_inferior ();
527 uiout->message (_("[Switching to inferior %d [%s] (%s)]\n"),
561 for (inferior *inf : all_inferiors ())
590 inferior in the loop. */
592 inferior *current_inf = current_inferior ();
593 for (inferior *inf : all_inferiors ())
607 /* Because target_pid_to_str uses the current inferior,
608 switch the inferior. */
627 uiout->text (_("\n\tis vfork child of inferior "));
632 uiout->text (_("\n\tis vfork parent of inferior "));
644 error (_("Requires argument (inferior id(s) to detach)"));
653 inferior *inf = find_inferior_id (num);
656 warning (_("Inferior ID %d not known."), num);
662 warning (_("Inferior ID %d is not running."), num);
669 warning (_("Inferior ID %d has no threads."), num);
683 error (_("Requires argument (inferior id(s) to kill)"));
692 inferior *inf = find_inferior_id (num);
695 warning (_("Inferior ID %d not known."), num);
701 warning (_("Inferior ID %d is not running."), num);
708 warning (_("Inferior ID %d has no threads."), num);
718 /* See inferior.h. */
721 switch_to_inferior_no_thread (inferior *inf)
731 maybe_switch_inferior (inferior *inf)
746 struct inferior *inf;
758 gdb_printf (_("[Current inferior is %d [%s] (%s)]\n"),
768 error (_("Inferior ID %d not known."), num);
776 error (_("Inferior has no threads."));
804 /* remove-inferior ID */
810 error (_("Requires an argument (inferior id(s) to remove)"));
816 struct inferior *inf = find_inferior_id (num);
820 warning (_("Inferior ID %d not known."), num);
826 warning (_("Can not remove current inferior %d."), num);
832 warning (_("Can not remove active inferior %d."), num);
840 struct inferior *
844 struct inferior *inf;
854 /* Setup the inferior's initial arch, based on information obtained
865 /* See inferior.h. */
868 switch_to_inferior_and_push_target (inferior *new_inf,
869 bool no_connection, inferior *org_inf)
877 /* Reuse the target for new inferior. */
881 gdb_printf (_("Added inferior %d on connection %d (%s)\n"),
887 gdb_printf (_("Added inferior %d\n"), new_inf->num);
890 /* add-inferior [-copies N] [-exec FILENAME] [-no-connection] */
933 inferior *orginf = current_inferior ();
939 inferior *inf = add_inferior_with_spaces ();
951 /* clone-inferior [-copies N] [ID] [-no-connection] */
957 struct inferior *orginf = NULL;
994 error (_("Inferior ID %d not known."), num);
1003 /* If no inferior id was specified, then the user wants to clone the
1004 current inferior. */
1013 struct inferior *inf;
1026 /* If the original inferior had a user specified target
1033 /* Copy properties from the original inferior to the new one. */
1059 gdb_printf (file, _("Printing of inferior events is %s.\n"), value);
1062 /* Return a new value for the selected inferior's id. */
1068 struct inferior *inf = current_inferior ();
1081 /* See inferior.h. */
1088 /* There's always one inferior. Note that this function isn't an
1090 routines may need to install their per-inferior data keys. We
1091 can only allocate an inferior when all those modules have done
1106 c = add_com ("add-inferior", no_class, add_inferior_command, _("\
1107 Add a new inferior.\n\
1108 Usage: add-inferior [-copies N] [-exec FILENAME] [-no-connection]\n\
1112 By default, the new inferior inherits the current inferior's connection.\n\
1113 If -no-connection is specified, the new inferior begins with\n\
1118 Remove inferior ID (or list of IDs).\n\
1121 add_com ("clone-inferior", no_class, clone_inferior_command, _("\
1122 Clone inferior ID.\n\
1123 Usage: clone-inferior [-copies N] [-no-connection] [ID]\n\
1124 Add N copies of inferior ID. The new inferiors have the same\n\
1125 executable loaded as the copied inferior. If -copies is not specified,\n\
1126 adds 1 copy. If ID is not specified, it is the current inferior\n\
1128 By default, the new inferiors inherit the copied inferior's connection.\n\
1133 Detach from inferior ID (or list of IDS).\n\
1138 Kill inferior ID (or list of IDs).\n\
1142 add_cmd ("inferior", class_run, inferior_command, _("\
1144 Usage: inferior ID\n\
1145 The new inferior ID must be currently known."),
1148 add_setshow_boolean_cmd ("inferior-events", no_class,
1150 Set printing of inferior events (such as inferior start and exit)."), _("\
1151 Show printing of inferior events (such as inferior start and exit)."), NULL,