+2017-08-28 Simon Marchi <simon.marchi@ericsson.com>
+
+ * cli/cli-script.c (define_command): Don't convert command name
+ to lower case.
+
2017-08-25 Joel Brobecker <brobecker@adacore.com>
* ada-lang.c (ada_lookup_struct_elt_type): Remove parameter "dispp".
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);
+2017-08-28 Simon Marchi <simon.marchi@ericsson.com>
+
+ * gdb.base/commands.exp (user_defined_command_case_sensitivity):
+ New proc, call it from toplevel.
+
2017-08-23 Sergio Durigan Junior <sergiodj@redhat.com>
PR remote/21852
"display user-defined empty command"
}
+# Test that the case with which the command was defined is preserved.
+
+proc_with_prefix user_defined_command_case_sensitivity {} {
+ # Define a first command with mixed case name.
+ set test "define Homer-Simpson"
+ gdb_test_multiple $test $test {
+ -re "End with" {
+ pass $test
+ }
+ }
+
+ gdb_test "print 123\nend" "" "enter commands 1"
+
+ # Define a second command, same name but different case.
+ set test "define HomeR-SimpsoN"
+ gdb_test_multiple $test $test {
+ -re "End with" {
+ pass $test
+ }
+ }
+
+ gdb_test "print 456\nend" "" "enter commands 2"
+
+ gdb_test "Homer-Simpson" " = 123" "execute command"
+ gdb_test "HomeR-SimpsoN" " = 456" "execute command"
+ gdb_test "HOMER-SIMPSON" "Undefined command.*" "try to call in upper case"
+ gdb_test "homer-simpson" "Undefined command.*" "try to call in lower case"
+}
+
# Test that "eval" in a user-defined command expands $argc/$argN.
proc_with_prefix user_defined_command_args_eval {} {
infrun_breakpoint_command_test
breakpoint_command_test
user_defined_command_test
+user_defined_command_case_sensitivity
user_defined_command_args_eval
user_defined_command_args_stack_test
user_defined_command_manyargs_test