Allow . character as part of command names.
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sun, 8 Sep 2019 19:54:18 +0000 (21:54 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 30 Nov 2019 08:37:49 +0000 (09:37 +0100)
commitbe09caf15d3d57da2173d26abdb0bf92ef90f28f
treedee1e80c88e618bec9c24fe31e9a0f226d9208ec
parent643c0cbedb4647702778ca8788a54053d1259d3b
Allow . character as part of command names.

This patch adds . as an allowed character for user defined commands.
Combined with 'define-prefix', this allows to e.g. define a set of Valgrind
specific user command corresponding to the Valgrind monitor commands
(such as check_memory, v.info, v.set, ...).

gdb/ChangeLog
2019-11-30  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* command.h (valid_cmd_char_p): Declare.
* cli/cli-decode.c (valid_cmd_char_p): New function factorizing
the check of valid command char.
(find_command_name_length, valid_user_defined_cmd_name_p): Use
valid_cmd_char_p.
* cli/cli-script.c (validate_comname): Likewise.
* completer.c (gdb_completer_command_word_break_characters):
Do not remove . from the word break char, update comments.
(complete_line_internal_1): Use valid_cmd_char_p.
* guile/scm-cmd.c (gdbscm_parse_command_name): Likewise.
* python/py-cmd.c (gdbpy_parse_command_name): Likewise.

gdb/testsuite/ChangeLog
2019-11-30  Philippe Waroquiers  <philippe.waroquiers@skynet.be>

* gdb.base/define.exp: Test . in command names.
* gdb.base/setshow.exp: Update test, as . is now part of
command name.
gdb/ChangeLog
gdb/cli/cli-decode.c
gdb/cli/cli-script.c
gdb/command.h
gdb/completer.c
gdb/guile/scm-cmd.c
gdb/python/py-cmd.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/define.exp
gdb/testsuite/gdb.base/setshow.exp