This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] info threads takes an argument
On Tuesday 15 February 2011 21:18:31, Michael Snyder wrote:
>
> find.txt
> 2011-02-15 Michael Snyder <msnyder@vmware.com>
>
> * command.h (enum command_class): New class 'no_set_class', for
> "show" commands without a corresponding "set" command.
> * value.c (_initialize_values): Use 'no_set_class' for "show values".
> * copying.c (_initialize_copying): Ditto for "show copying" and
> "show warranty".
> * cli/cli-cmds.c (init_cli_cmds): Ditto for "show commands" and
> "show version".
> * cli/cli-setshow.c (cmd_show_list): Skip "show" commands for
> which there is no corresponding "set" command (eg. "show copying").
Wrong changelog entry, btw. Here's the correct one, to ease
code archaeology / web search in the future:
2011-02-15 Michael Snyder <msnyder@vmware.com>
* thread.c (info_threads_command): Process arg as thread id,
or list of thread ids.
(thread_find_command): New command.
(_initialize_thread): Document argument for info threads.
Document 'thread find' command.
* NEWS: Document new command "thread find".
> Index: NEWS
> ===================================================================
> RCS file: /cvs/src/src/gdb/NEWS,v
> retrieving revision 1.425
> diff -u -p -u -p -r1.425 NEWS
> --- NEWS 5 Feb 2011 05:27:23 -0000 1.425
> +++ NEWS 15 Feb 2011 21:14:27 -0000
> @@ -3,6 +3,10 @@
>
> *** Changes since GDB 7.2
>
> +* GDB has a new command: "thread find [REGEXP]".
> + It finds the thread id whose name, target id, or thread extra info
> + matches the given regular expression.
IMO, it'd be nice to mention the "info threads" change as well.
Anyway, the reason I'm replying is that I noticed a couple
of new FAILs in this test, and looking at the log, I noticed
another issue:
info threads 2 4 6
Id Target Id Frame
2 Thread 0x2aaaab6f4700 (LWP 335) "threadname_2" 0x00002aaaab24e2c3 in select () from /lib/libc.so.6
Id Target Id Frame
4 Thread 0x2aaaabaf7700 (LWP 337) "threadname_4" 0x00002aaaab24e2c3 in select () from /lib/libc.so.6
Id Target Id Frame
6 Thread 0x2aaaabef9700 (LWP 339) "threadname_6" 0x00002aaaab1f7050 in strchrnul () from /lib/libc.so.6
(gdb) FAIL: gdb.threads/thread-find.exp: info threads 2 4 6
info threads 3-5
Id Target Id Frame
3 Thread 0x2aaaab8f5700 (LWP 336) "threadname_3" 0x00002aaaab24e2c3 in select () from /lib/libc.so.6
Id Target Id Frame
4 Thread 0x2aaaabaf7700 (LWP 337) "threadname_4" 0x00002aaaab24e2c3 in select () from /lib/libc.so.6
Id Target Id Frame
5 Thread 0x2aaaabcf8700 (LWP 338) "threadname_5" 0x00002aaaab24e2c3 in select () from /lib/libc.so.6
(gdb) FAIL: gdb.threads/thread-find.exp: info threads 3-5
The header is printed once for each entry. Was that
intended? It doesn't seem right to me.
--
Pedro Alves