Provide completer for "info registers"
authorAndreas Arnez <arnez@linux.vnet.ibm.com>
Fri, 12 Dec 2014 16:11:22 +0000 (17:11 +0100)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Fri, 12 Dec 2014 16:11:22 +0000 (17:11 +0100)
commit71c247087cbff23fbbe10333a9e504f3e197c107
treef7d0e7ce48353d176a38f17a4870b9516ece95a6
parentf5b95c01fbe709f73ca3ba60136ff973dcb706a5
Provide completer for "info registers"

Provide a new completion function for the argument of "info
registers", "info all-registers", and the "lr" command in dbx mode.
Without this patch the default symbol completer is used, which is more
confusing than helpful.

Also add a test for this new feature to "completion.exp": Determine
the target's available set of registers/reggroups and compare this to
the completion of "info registers ".  For determining the available
registers involve the new "maint print user-registers" command.

gdb/ChangeLog:

* completer.c: Include "target.h", "reggroups.h", and
"user-regs.h".
(reg_or_group_completer): New.
* completer.h (reg_or_group_completer): Declare.
* infcmd.c (_initialize_infcmd): Set reg_or_group_completer for
the "info registers" and "info all-registers" commands and the
dbx-mode "lr" command.

gdb/testsuite/ChangeLog:

* gdb.base/completion.exp: Add test for completion of "info
registers ".
gdb/ChangeLog
gdb/completer.c
gdb/completer.h
gdb/infcmd.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/completion.exp