]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: use option framework for add-inferior and clone-inferior
authorAndrew Burgess <aburgess@redhat.com>
Mon, 30 Sep 2024 15:01:26 +0000 (16:01 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Mon, 4 Nov 2024 16:11:51 +0000 (16:11 +0000)
commitebc73070f4b85e4adee7d2f49cb32e2bd7b16324
tree6e8b0774a4b884836c2b01850c051d1bc79e0ef5
parent3105b46ed1ed31de8e3cb9768ea181801fc05008
gdb: use option framework for add-inferior and clone-inferior

Convert the add-inferior and clone-inferior commands to make use of
the option framework.  This improves the tab completion for these
commands.

Previously the add-inferior command used a trick to simulate
completion of -exec argument.  The command use filename completion for
everything on the command line, thus you could do:

  (gdb) add-inferior /path/to/some/fil<TAB>

and GDB would complete the file name, even though add-inferior doesn't
really take a filename as an argument.  This helped a little though
because, if the user did this:

  (gdb) add-inferior -exec /path/to/some/fil<TAB>

then the file name would be completed.  However, GDB didn't really
understand the options, so couldn't offer completion of the options
themselves.

After this commit, the add-inferior command makes use of the recently
added gdb::option::filename_option_def feature.  This means that the
user now has full completion of the option names, and that file names
will still complete for the '-exec' option, but will no longer
complete if the '-exec' option is not used.

I have also converted the clone-inferior command, though this command
does not use any file name options.  This command does now have proper
completion of the command options.
gdb/inferior.c