Lines Matching refs:inf
60 set_current_inferior (struct inferior *inf)
63 gdb_assert (inf != NULL);
65 current_inferior_ = inferior_ref::new_reference (inf);
204 /* Notify interpreters and observers that inferior INF was added. */
207 notify_inferior_added (inferior *inf)
209 interps_notify_inferior_added (inf);
210 gdb::observers::inferior_added.notify (inf);
216 inferior *inf = new inferior (pid);
218 inferior_list.push_back (*inf);
220 notify_inferior_added (inf);
223 inferior_appeared (inf, pid);
225 return inf;
231 struct inferior *inf = add_inferior_silent (pid);
237 inf->num,
240 gdb_printf (_("[New inferior %d]\n"), inf->num);
243 return inf;
274 /* Notify interpreters and observers that inferior INF was removed. */
277 notify_inferior_removed (inferior *inf)
279 interps_notify_inferior_removed (inf);
280 gdb::observers::inferior_removed.notify (inf);
284 delete_inferior (struct inferior *inf)
286 inf->clear_thread_list ();
288 auto it = inferior_list.iterator_to (*inf);
291 notify_inferior_removed (inf);
295 inferior INF then we need to make this call before we delete the
297 inf->pop_all_targets ();
300 if (inf->pspace->empty ())
301 delete inf->pspace;
303 delete inf;
306 /* Notify interpreters and observers that inferior INF disappeared. */
309 notify_inferior_disappeared (inferior *inf)
311 interps_notify_inferior_disappeared (inf);
312 gdb::observers::inferior_exit.notify (inf);
318 exit_inferior (struct inferior *inf)
320 inf->clear_thread_list ();
322 notify_inferior_disappeared (inf);
324 inf->pid = 0;
325 inf->fake_pid_p = false;
326 inf->priv = NULL;
328 if (inf->vfork_parent != NULL)
330 inf->vfork_parent->vfork_child = NULL;
331 inf->vfork_parent = NULL;
333 if (inf->vfork_child != NULL)
335 inf->vfork_child->vfork_parent = NULL;
336 inf->vfork_child = NULL;
339 inf->pending_detach = false;
341 inf->control = inferior_control_state (NO_STOP_QUIETLY);
351 detach_inferior (inferior *inf)
354 int pid = inf->pid;
356 exit_inferior (inf);
360 inf->num,
364 /* Notify interpreters and observers that inferior INF appeared. */
367 notify_inferior_appeared (inferior *inf)
369 interps_notify_inferior_appeared (inf);
370 gdb::observers::inferior_appeared.notify (inf);
374 inferior_appeared (struct inferior *inf, int pid)
382 inf->pid = pid;
383 inf->has_exit_code = false;
384 inf->exit_code = 0;
386 notify_inferior_appeared (inf);
392 for (inferior *inf : all_inferiors ())
393 if (inf->num == num)
394 return inf;
407 for (inferior *inf : all_inferiors (targ))
408 if (inf->pid == pid)
409 return inf;
432 for (inferior *inf : all_inferiors ())
433 if (inf->pspace == pspace)
434 return inf;
442 for (inferior *inf ATTRIBUTE_UNUSED : all_non_exited_inferiors ())
457 for (inferior *inf : all_non_exited_inferiors (proc_target))
458 if (inf->has_execution ())
459 for (thread_info *tp ATTRIBUTE_UNUSED : inf->non_exited_threads ())
484 for (inferior *inf : all_inferiors_safe ())
486 if (!inf->deletable ()
487 || !inf->removable
488 || inf->pid != 0)
491 delete_inferior (inf);
521 struct inferior *inf = current_inferior ();
522 const char *filename = inf->pspace->exec_filename ();
528 inf->num, inferior_pid_to_str (inf->pid).c_str (), filename);
561 for (inferior *inf : all_inferiors ())
563 if (!number_is_in_list (requested_inferiors, inf->num))
566 std::string conn = uiout_field_connection (inf->process_target ());
593 for (inferior *inf : all_inferiors ())
595 if (!number_is_in_list (requested_inferiors, inf->num))
600 if (inf == current_inf)
605 uiout->field_signed ("number", inf->num);
609 switch_to_inferior_no_thread (inf);
611 uiout->field_string ("target-id", inferior_pid_to_str (inf->pid));
613 std::string conn = uiout_field_connection (inf->process_target ());
616 if (inf->pspace->exec_filename () != nullptr)
617 uiout->field_string ("exec", inf->pspace->exec_filename (),
625 if (inf->vfork_parent)
628 uiout->field_signed ("vfork-parent", inf->vfork_parent->num);
630 if (inf->vfork_child)
633 uiout->field_signed ("vfork-child", inf->vfork_child->num);
653 inferior *inf = find_inferior_id (num);
654 if (inf == NULL)
660 if (inf->pid == 0)
666 thread_info *tp = any_thread_of_inferior (inf);
692 inferior *inf = find_inferior_id (num);
693 if (inf == NULL)
699 if (inf->pid == 0)
705 thread_info *tp = any_thread_of_inferior (inf);
721 switch_to_inferior_no_thread (inferior *inf)
723 set_current_inferior (inf);
725 set_current_program_space (inf->pspace);
731 maybe_switch_inferior (inferior *inf)
734 if (inf != current_inferior ())
737 switch_to_inferior_no_thread (inf);
746 struct inferior *inf;
751 inf = current_inferior ();
752 gdb_assert (inf != nullptr);
753 const char *filename = inf->pspace->exec_filename ();
759 inf->num, inferior_pid_to_str (inf->pid).c_str (),
766 inf = find_inferior_id (num);
767 if (inf == NULL)
770 if (inf->pid != 0)
772 if (inf != current_inferior ())
774 thread_info *tp = any_thread_of_inferior (inf);
788 switch_to_inferior_no_thread (inf);
820 struct inferior *inf = find_inferior_id (num);
822 if (inf == NULL)
828 if (!inf->deletable ())
834 if (inf->pid != 0)
840 delete_inferior (inf);
848 struct inferior *inf;
854 inf = add_inferior (0);
855 inf->pspace = pspace;
856 inf->aspace = pspace->aspace;
861 inf->set_arch (gdbarch_find_by_info (info));
864 gdb_assert (inf->arch () != nullptr);
866 return inf;
983 inferior *inf = add_inferior_with_spaces ();
985 switch_to_inferior_and_push_target (inf, opts.no_connection, orginf);
1097 struct inferior *inf;
1103 inf = add_inferior (0);
1104 inf->pspace = pspace;
1105 inf->aspace = pspace->aspace;
1106 inf->set_arch (orginf->arch ());
1108 switch_to_inferior_and_push_target (inf, opts.no_connection, orginf);
1112 if (inf->tdesc_info.from_user_p ())
1113 inf->tdesc_info = orginf->tdesc_info;
1118 inf->set_args (orginf->args ());
1119 inf->set_cwd (orginf->cwd ());
1120 inf->set_tty (orginf->tty ());
1127 inf->environment.set
1132 inf->environment.unset (unset_var.c_str ());
1134 gdb::observers::inferior_cloned.notify (orginf, inf);
1152 struct inferior *inf = current_inferior ();
1154 return value_from_longest (builtin_type (gdbarch)->builtin_int, inf->num);