"backtrace full/no-filters/hide" completer
authorPedro Alves <palves@redhat.com>
Wed, 12 Jun 2019 23:06:53 +0000 (00:06 +0100)
committerPedro Alves <palves@redhat.com>
Wed, 12 Jun 2019 23:20:08 +0000 (00:20 +0100)
commit90a1ef8762a57f3f57007db2186099c026152034
tree1ae652fcbc0961b5e0c0a4ecf561c9360bd2626e
parentd4c16835cad70bd8c04ff30d5d6f40ac65e7f7e1
"backtrace full/no-filters/hide" completer

"backtrace"'s completer now completes on command options:

 (gdb) bt -[TAB]
 -entry-values         -full                 -no-filters           -past-main
 -frame-arguments      -hide                 -past-entry           -raw-frame-arguments

But it doesn't know how to complete on qualifiers:

 (gdb) bt fu[TAB]
 funlockfile       futimens          futimes.c
 funlockfile.c     futimens.c        futimesat
 futex-internal.h  futimes           futimesat.c

This commit fixes that:

 (gdb) bt fu[TAB]ll
 (gdb) bt n[TAB]o-filters
 (gdb) bt h[TAB]ide

I considered teaching the gdb::option framework to handle non-'-'
options, but decided it wasn't worth it for this special case, and I'd
rather not make it easy to add new qualifier-like options.

gdb/ChangeLog:
2019-06-13  Pedro Alves  <palves@redhat.com>

* stack.c (parse_backtrace_qualifiers): New.
(backtrace_command): Use it.
(backtrace_command_completer): Complete on qualifiers.

gdb/testsuite/ChangeLog:
2019-06-13  Pedro Alves  <palves@redhat.com>

* gdb.base/options.exp (test-backtrace): Test completing qualifiers.
gdb/ChangeLog
gdb/stack.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/options.exp