diff options
author | Pedro Alves <palves@redhat.com> | 2019-06-18 01:20:45 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-06-18 01:20:45 +0100 |
commit | 9507d5238bda0fb34ea35a71f81f6622314d3993 (patch) | |
tree | 93a46339081fae6c219206f3e427a8a2edbe99f8 /gdb/cli/cli-cmds.c | |
parent | 5bb4fed3d48e4637015a89e40672c938c7f61e72 (diff) | |
download | gdb-9507d5238bda0fb34ea35a71f81f6622314d3993.zip gdb-9507d5238bda0fb34ea35a71f81f6622314d3993.tar.gz gdb-9507d5238bda0fb34ea35a71f81f6622314d3993.tar.bz2 |
Make "info threads" use the gdb::option framework
I had this in my local "print -OPT" branch, but had decided not to
include in the original series, because it's not as useful as the
others. I'm sending it now, since I had it written anyway.
This makes "info threads" use the gdb::option framework to process
options. There's only one option today (-gid), and it isn't used much
frequently unless you're looking at matching MI output. Still, this
was in the neighborhood of "thread apply" so I had converted it.
The main advantage is that TAB completion now shows you the available
options, and gives you a hint to what the command accepts as operand
argument, including showing a metasyntactic variable:
(gdb) info threads [TAB]
-gid ID
(gdb) help info threads
Display currently known threads.
Usage: info threads [OPTION]... [ID]...
Options:
-gid
Show global thread IDs.
If ID is given, it is a space-separated list of IDs of threads to display.
Otherwise, all threads are displayed.
(gdb)
gdb/ChangeLog:
2019-06-13 Pedro Alves <palves@redhat.com>
* NEWS (Completion improvements): Mention "info threads".
* thread.c (struct info_threads_opts, info_threads_option_defs)
(make_info_threads_options_def_group): New.
(info_threads_command): Use gdb::option::process_options.
(info_threads_command_completer): New.
(_initialize_thread): Use gdb::option::build_help to build the
help text for "info threads".
gdb/testsuite/ChangeLog:
2019-06-13 Pedro Alves <palves@redhat.com>
* gdb.base/options.exp (test-info-threads): New procedure.
(top level): Call it.
Diffstat (limited to 'gdb/cli/cli-cmds.c')
0 files changed, 0 insertions, 0 deletions