int
have_live_inferiors (void)
{
- struct cleanup *old_chain;
struct inferior *inf;
- old_chain = make_cleanup_restore_current_thread ();
-
for (inf = inferior_list; inf; inf = inf->next)
if (inf->pid != 0)
{
struct thread_info *tp;
tp = any_thread_of_process (inf->pid);
- if (tp)
- {
- switch_to_thread (tp->ptid);
-
- if (target_has_execution)
- break;
- }
+ if (tp && target_has_execution_1 (tp->ptid))
+ break;
}
- do_cleanups (old_chain);
-
return inf != NULL;
}
{
int num, pid;
struct thread_info *tp;
+ struct get_number_or_range_state state;
if (!args || !*args)
error (_("Requires argument (inferior id(s) to detach)"));
- while (*args != '\0')
+ init_number_or_range (&state, args);
+ while (!state.finished)
{
- num = get_number_or_range (&args);
+ num = get_number_or_range (&state);
if (!valid_gdb_inferior_id (num))
{
{
int num, pid;
struct thread_info *tp;
+ struct get_number_or_range_state state;
if (!args || !*args)
error (_("Requires argument (inferior id(s) to kill)"));
- while (*args != '\0')
+ init_number_or_range (&state, args);
+ while (!state.finished)
{
- num = get_number_or_range (&args);
+ num = get_number_or_range (&state);
if (!valid_gdb_inferior_id (num))
{
{
int num;
struct inferior *inf;
+ struct get_number_or_range_state state;
if (args == NULL || *args == '\0')
error (_("Requires an argument (inferior id(s) to remove)"));
- while (*args != '\0')
+ init_number_or_range (&state, args);
+ while (!state.finished)
{
- num = get_number_or_range (&args);
+ num = get_number_or_range (&state);
inf = find_inferior_id (num);
if (inf == NULL)