summaryrefslogtreecommitdiff
path: root/gdb/inferior.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/inferior.c')
-rw-r--r--gdb/inferior.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gdb/inferior.c b/gdb/inferior.c
index eb33b9a3766..db4dd41e6b5 100644
--- a/gdb/inferior.c
+++ b/gdb/inferior.c
@@ -612,13 +612,15 @@ detach_inferior_command (char *args, int from_tty)
{
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))
{
@@ -646,13 +648,15 @@ kill_inferior_command (char *args, int from_tty)
{
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))
{
@@ -747,13 +751,15 @@ remove_inferior_command (char *args, int from_tty)
{
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)