diff options
author | Michael Snyder <msnyder@vmware.com> | 2011-02-19 01:02:56 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2011-02-19 01:02:56 +0000 |
commit | 7a45ebd700abd6b54a8ef9afea260b258c49061a (patch) | |
tree | af027e8a132c279581ff4add81f0ad7819d55fd8 /gdb | |
parent | 22e881728a9dda8f87e06ad32f865a8fd51ca63e (diff) | |
download | gdb-7a45ebd700abd6b54a8ef9afea260b258c49061a.zip gdb-7a45ebd700abd6b54a8ef9afea260b258c49061a.tar.gz gdb-7a45ebd700abd6b54a8ef9afea260b258c49061a.tar.bz2 |
2011-02-18 Michael Snyder <msnyder@vmware.com>
* thread.c (info_threads_command): Re-implement using
get_number_or_range.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/thread.c | 26 |
2 files changed, 8 insertions, 23 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9a75f00..3cae1d3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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> * common/ax.def: New file. diff --git a/gdb/thread.c b/gdb/thread.c index d4cd855..e297b54 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -976,32 +976,12 @@ info_threads_command (char *arg, int from_tty) while (arg != NULL && *arg != '\0') { - int tmp_tid = strtol (arg, &arg, 0); - unsigned int highrange; + tid = get_number_or_range (&arg); - if (tmp_tid <= 0) - error (_("invalid thread id %d"), tmp_tid); + if (tid <= 0) + error (_("invalid thread id %d"), tid); - tid = tmp_tid; 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); - } - } } } |