Index: cli/cli-decode.c =================================================================== RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v retrieving revision 1.118 diff -u -p -r1.118 cli-decode.c --- cli/cli-decode.c 10 Apr 2013 15:11:12 -0000 1.118 +++ cli/cli-decode.c 17 Apr 2013 08:56:13 -0000 @@ -1556,6 +1556,9 @@ lookup_cmd (const char **line, struct cm } else { + if (**line != '\0' && c->type == set_cmd && !isspace (**line)) + error (_("Argument must be preceded by space.")); + /* We've got something. It may still not be what the caller wants (if this command *needs* a subcommand). */ while (**line == ' ' || **line == '\t') Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/ChangeLog,v retrieving revision 1.15428 diff -u -p -r1.15428 ChangeLog --- ChangeLog 17 Apr 2013 01:02:01 -0000 1.15428 +++ ChangeLog 17 Apr 2013 08:13:56 -0000 @@ -1,3 +1,9 @@ +2013-04-17 Muhammad Bilal + + PR gdb/10462 + * cli/cli-decode.c (lookup_command): Show an error if there is no space + before argument. + 2013-04-17 Yao Qi * top.c (print_gdb_configuration): Print configure-time Index: gdb.base/default.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/default.exp,v retrieving revision 1.64 diff -u -p -r1.64 default.exp --- gdb.base/default.exp 15 Apr 2013 18:09:02 -0000 1.64 +++ gdb.base/default.exp 17 Apr 2013 09:04:13 -0000 @@ -847,6 +847,13 @@ gdb_test "whatis" "The history is empty. gdb_test "where" "No stack." "where" #test x gdb_test "x" "Argument required .starting display address.*" "x" +#test argument must be preceded by space +foreach x {"history file" "solib-search-path" "data-directory"} { + foreach y {"/home/" "." "~/home"} { + gdb_test "set $x$y" "Argument must be preceded by space." "check space before argument" + gdb_test_no_output "set $x $y" "set $x $y" + } +} gdb_exit Index: ChangeLog =================================================================== RCS file: /cvs/src/src/gdb/testsuite/ChangeLog,v retrieving revision 1.3628 diff -u -p -r1.3628 ChangeLog --- ChangeLog 15 Apr 2013 20:37:36 -0000 1.3628 +++ ChangeLog 17 Apr 2013 08:23:11 -0000 @@ -1,3 +1,8 @@ +2013-04-17 Muhammad Bilal + + PR gdb/10462 + * gdb.base/default.exp: Add test case. + 2013-04-15 Siva Chandra Reddy Add option to link testcases with Pthreads library when