diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2017-08-28 23:05:04 +0200 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2017-08-28 23:05:04 +0200 |
commit | fd437cbc432d5421492a5b0e371750de104cce93 (patch) | |
tree | 470d6ea77aa8fa4ce9cc54528944a7cf9d1e7ffd /gdb/cli | |
parent | 90efb6422939ca031804266fba669f77c22a274a (diff) | |
download | gdb-fd437cbc432d5421492a5b0e371750de104cce93.zip gdb-fd437cbc432d5421492a5b0e371750de104cce93.tar.gz gdb-fd437cbc432d5421492a5b0e371750de104cce93.tar.bz2 |
define_command: Don't convert command name to lower case
Commit
Command names: make them case sensitive
3d7b173c29900879c9a5958dd6029fd36666e57c
made command name lookup case sensitive. However, define_command, used
when creating a user-defined command, converts the command name to
lowercase, assuming that the command name lookup works in a case
insensitive way. This causes user-defined commands with capital letters
in their name to only be callable with a lowercase version:
(gdb) define Foo
Type commands for definition of "Foo".
End with a line saying just "end".
>print 1
>end
(gdb) Foo
Undefined command: "Foo". Try "help".
(gdb) foo
$1 = 1
This patch removes that conversion to lowercase, so that the user can
call the command with the same name they provided.
gdb/ChangeLog:
* cli/cli-script.c (define_command): Don't convert command name
to lower case.
gdb/testsuite/ChangeLog:
* gdb.base/commands.exp (user_defined_command_case_sensitivity):
New proc, call it from toplevel.
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-script.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 4b8ae0b..64b4c2b 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -1478,12 +1478,6 @@ define_command (char *comname, int from_tty) comname = xstrdup (comname); - /* If the rest of the commands will be case insensitive, this one - should behave in the same manner. */ - for (tem = comname; *tem; tem++) - if (isupper (*tem)) - *tem = tolower (*tem); - xsnprintf (tmpbuf, sizeof (tmpbuf), "Type commands for definition of \"%s\".", comfull); command_line_up cmds = read_command_lines (tmpbuf, from_tty, 1, 0, 0); |