Add completer for skip numbers
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 12 Nov 2018 15:38:44 +0000 (10:38 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 12 Nov 2018 15:38:44 +0000 (10:38 -0500)
commit53a89d6e5861d23b2b9ad0c82247daddc117701a
tree2fb5a0d022e771bf15e05b0a9c007bc57349a55d
parent8a758655b3ee39bed245a6ba2fc9f81f77813443
Add completer for skip numbers

Add completer to various commands that accept skip numbers:

  - skip enable
  - skip disable
  - skip delete
  - info skip

These commands also accept ranges, the completer works for that but is
not very smart.  It will suggest invalid ranges, for example when doing
"2-<TAB>" it will suggest "1", which would not result in a valid range.
Also, it will keep suggesting when doing "1-2-<TAB>", even though it's
an invalid syntax.

A future idea would be to make a re-usable and well-tested completer for
numbers and ranges.  I think it could at least be re-used for breakpoint
and thread numbers (for example with the "enable breakpoints" command).

gdb/ChangeLog:

* skip.c (complete_skip_number): New function.
(_initialize_step_skip): Add completers to some skip commands.

gdb/testsuite/ChangeLog:

* gdb.base/skip.exp: Add standard_testfile.  Add "skip delete"
completer tests.
gdb/ChangeLog
gdb/skip.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/skip.exp