diff options
author | Doug Evans <dje@google.com> | 2011-11-15 05:06:35 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2011-11-15 05:06:35 +0000 |
commit | ed59ded5ebf4f5eb5014612020c88ebd27f0b819 (patch) | |
tree | 364c1a0084e846164c80cd0d339afcb9a5e7e209 /gdb/cli/cli-decode.c | |
parent | 81f5d455defd839446d1f1b51ed84f170b47a5c1 (diff) | |
download | gdb-ed59ded5ebf4f5eb5014612020c88ebd27f0b819.zip gdb-ed59ded5ebf4f5eb5014612020c88ebd27f0b819.tar.gz gdb-ed59ded5ebf4f5eb5014612020c88ebd27f0b819.tar.bz2 |
Make "!" an alias for "shell".
* NEWS: Add mention.
* cli/cli-cmds.c (init_cli_cmds): Remove xdb_commands condition on
adding "!" command, always add it.
* cli/cli-decode.c (find_command_name_length): Recognize "!" as a
command of length one.
doc/
* gdb.texinfo (Shell Commands): Document "!".
testsuite/
* gdb.base/shell.exp: New file.
Diffstat (limited to 'gdb/cli/cli-decode.c')
-rw-r--r-- | gdb/cli/cli-decode.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 0870782..22ae6ec 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -1127,11 +1127,16 @@ find_command_name_length (const char *text) Note that this is larger than the character set allowed when creating user-defined commands. */ + /* Recognize '!' as a single character command so that, e.g., "!ls" + works as expected. */ + if (*p == '!') + return 1; + while (isalnum (*p) || *p == '-' || *p == '_' /* Characters used by TUI specific commands. */ || *p == '+' || *p == '<' || *p == '>' || *p == '$' /* Characters used for XDB compatibility. */ - || (xdb_commands && (*p == '!' || *p == '/' || *p == '?'))) + || (xdb_commands && (*p == '/' || *p == '?'))) p++; return p - text; |