2011-02-18 Michael Snyder <msnyder@vmware.com>
* thread.c (info_threads_command): Re-implement using get_number_or_range.
This commit is contained in:
parent
22e881728a
commit
7a45ebd700
|
@ -1,3 +1,8 @@
|
||||||
|
2011-02-18 Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
|
* thread.c (info_threads_command): Re-implement using
|
||||||
|
get_number_or_range.
|
||||||
|
|
||||||
2011-02-18 Tom Tromey <tromey@redhat.com>
|
2011-02-18 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* common/ax.def: New file.
|
* common/ax.def: New file.
|
||||||
|
|
26
gdb/thread.c
26
gdb/thread.c
|
@ -976,32 +976,12 @@ info_threads_command (char *arg, int from_tty)
|
||||||
|
|
||||||
while (arg != NULL && *arg != '\0')
|
while (arg != NULL && *arg != '\0')
|
||||||
{
|
{
|
||||||
int tmp_tid = strtol (arg, &arg, 0);
|
tid = get_number_or_range (&arg);
|
||||||
unsigned int highrange;
|
|
||||||
|
|
||||||
if (tmp_tid <= 0)
|
if (tid <= 0)
|
||||||
error (_("invalid thread id %d"), tmp_tid);
|
error (_("invalid thread id %d"), tid);
|
||||||
|
|
||||||
tid = tmp_tid;
|
|
||||||
print_thread_info (uiout, tid, -1);
|
print_thread_info (uiout, tid, -1);
|
||||||
|
|
||||||
while (*arg == ' ' || *arg == '\t')
|
|
||||||
++arg;
|
|
||||||
|
|
||||||
if (*arg == '-')
|
|
||||||
{
|
|
||||||
/* Do a range of threads. Must be in ascending order. */
|
|
||||||
++arg; /* Skip the hyphen. */
|
|
||||||
highrange = strtoul (arg, &arg, 0);
|
|
||||||
if (highrange < tid)
|
|
||||||
error (_("inverted range"));
|
|
||||||
|
|
||||||
/* Do the threads in the range (first one already done). */
|
|
||||||
while (tid < highrange)
|
|
||||||
{
|
|
||||||
print_thread_info (uiout, ++tid, -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue