aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index b48909f..6ad1807 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1214,6 +1214,7 @@ thread_apply_command (char *tidlist, int from_tty)
char *cmd;
struct cleanup *old_chain;
char *saved_cmd;
+ struct get_number_or_range_state state;
if (tidlist == NULL || *tidlist == '\000')
error (_("Please specify a thread ID list"));
@@ -1227,13 +1228,15 @@ thread_apply_command (char *tidlist, int from_tty)
execute_command. */
saved_cmd = xstrdup (cmd);
old_chain = make_cleanup (xfree, saved_cmd);
- while (tidlist < cmd)
+
+ init_number_or_range (&state, tidlist);
+ while (!state.finished && state.string < cmd)
{
struct thread_info *tp;
int start;
char *p = tidlist;
- start = get_number_or_range (&tidlist);
+ start = get_number_or_range (&state);
make_cleanup_restore_current_thread ();