This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] fix for checking the command ambiguousness.
- From: Muhammad Bilal <mbilal at codesourcery dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 28 Aug 2013 19:17:23 +0500
- Subject: Re: [patch] fix for checking the command ambiguousness.
- Authentication-results: sourceware.org; auth=none
- References: <521C6FDD dot 3090909 at codesourcery dot com> <521CEB86 dot 7060106 at redhat dot com> <521DB1E1 dot 5040804 at codesourcery dot com> <521DE287 dot 2010208 at redhat dot com>
On 08/28/2013 04:44 PM, Pedro Alves wrote:
Hi!
Unfortunately, I'm having trouble applying your patches. Seems like
they're mangled somehow (line wrapped, etc.). From your email's headers
I see you're using Thunderbird. Could you please go through:
http://sourceware.org/gdb/wiki/ContributionChecklist#Submitting_patches
and fix it up as necessary (and then check if you can apply
a patch that you privately send yourself?)
Thanks,
Sorry, for inconvenience
Please, find attached file.
./
2013-07-27 Muhammad Bilal <mbilal@codesourcery.com>
* cli/cli-decode.c (lookup_cmd_composition): Check command
ambiguousness
with 'nfound' instead of CMD_LIST_AMBIGUOUS.
./testsuite/
2013-08-28 Muhammad Bilal <mbilal@codesourcery.com>
* gdb.python/py-parameter.exp: Test command ambiguousness.
Thanks,
-Bilal
Index: cli/cli-decode.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-decode.c,v
retrieving revision 1.119
diff -u -p -r1.119 cli-decode.c
--- cli/cli-decode.c 24 Apr 2013 14:29:17 -0000 1.119
+++ cli/cli-decode.c 28 Aug 2013 14:00:46 -0000
@@ -1729,7 +1729,7 @@ lookup_cmd_composition (const char *text
*cmd = find_cmd (command, len, cur_list, 1, &nfound);
}
- if (*cmd == CMD_LIST_AMBIGUOUS)
+ if (nfound > 1)
{
return 0; /* ambiguous */
}
Index: testsuite/gdb.python/py-parameter.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-parameter.exp,v
retrieving revision 1.8
diff -u -p -r1.8 py-parameter.exp
--- testsuite/gdb.python/py-parameter.exp 1 Jan 2013 06:41:26 -0000 1.8
+++ testsuite/gdb.python/py-parameter.exp 28 Aug 2013 14:00:46 -0000
@@ -29,6 +29,13 @@ if { [skip_python_tests] } { continue }
# We use "." here instead of ":" so that this works on win32 too.
gdb_test "python print (gdb.parameter ('directories'))" "$srcdir/$subdir.\\\$cdir.\\\$cwd"
+#Test command ambiguousness
+gdb_test "python gdb.parameter('print symbo on')" \
+"Traceback.*File.*line 1.*RuntimeError.*Could not find parameter.*print symbo on.*Error while executing Python code.*" \
+"set print symbo on"
+gdb_test "show print symbo" "Ambiguous show print command \"symbo\".*" \
+"show print symbo"
+
# Test a simple boolean parameter.
gdb_py_test_multiple "Simple gdb booleanparameter" \
"python" "" \