This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] patch for review of PR gdb/10462
- From: mbilal <mbilal at codesourcery dot com>
- To: <palves at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>, <hafiz_abid at mentor dot com>, <schwab at suse dot de>, <tromey at redhat dot com>
- Date: Wed, 17 Apr 2013 19:52:40 +0500
- Subject: Re: [patch] patch for review of PR gdb/10462
- References: <516EB58F dot 2090603 at codesourcery dot com>
On 04/17/2013 Pedro Alves wrote:
>BTW, is there a rationale for putting this in default.exp, which
>is about default actions of commands? I think setshow.exp might make
>more sense
fixed.
>The uniqueness issue is still here:
fixed.
Thanks Pedro for review.
Find attached patch.
Ok?
Thanks,
-Bilal
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 12:16:37 -0000
@@ -1556,6 +1556,9 @@ lookup_cmd (const char **line, struct cm
}
else
{
+ if (c->type == set_cmd && **line != '\0' && !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 <mbilal@codesourcery.com>
+
+ PR gdb/10462
+ * cli/cli-decode.c (lookup_command): Show an error if there is no space
+ before argument.
+
2013-04-17 Yao Qi <yao@codesourcery.com>
* top.c (print_gdb_configuration): Print configure-time
Index: gdb.base/setshow.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/setshow.exp,v
retrieving revision 1.29
diff -u -p -r1.29 setshow.exp
--- gdb.base/setshow.exp 10 Apr 2013 15:11:12 -0000 1.29
+++ gdb.base/setshow.exp 17 Apr 2013 14:13:32 -0000
@@ -259,3 +259,10 @@ gdb_test "show verbose" "Verbose printin
gdb_test_no_output "set verbose off" "set verbose off"
#test show verbose off
gdb_test "show verbose" "Verbosity is off..*" "show verbose (off)"
+#test argument must be preceded by space
+foreach x {"history file" "solib-search-path" "data-directory"} {
+ foreach y {"/home/" "." "~/home" "=home"} {
+ gdb_test "set $x$y" "Argument must be preceded by space." \
+ "$x is not set to $y"
+ }
+}
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 14:14:53 -0000
@@ -1,3 +1,8 @@
+2013-04-17 Muhammad Bilal <mbilal@codesourcery.com>
+
+ PR gdb/10462
+ * gdb.base/setshow.exp: Add test case.
+
2013-04-15 Siva Chandra Reddy <sivachandra@google.com>
Add option to link testcases with Pthreads library when