Bug 10462 - set command does not detect syntax error
Summary: set command does not detect syntax error
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: cli (show other bugs)
Version: 6.3
: P2 minor
Target Milestone: 7.7
Assignee: hmb
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-30 01:43 UTC by Roy Smith
Modified: 2013-04-24 14:37 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2013-04-17 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Roy Smith 2009-07-30 01:43:53 UTC
The correct syntax for setting a variable is "set name value".  If you accidentally type "set name=value", it 
silently accepts it and just assumes the "=" is part of the value.  For example:

(gdb) set solib-search-path=foo:bar
(gdb) show solib-search-path 
The search path for loading non-absolute shared library symbol files is "=foo:bar".

This is not the expected behavior, and leads to confusion when things don't work as expected.

I got this on "GNU gdb Red Hat Linux (6.3.0.0-1.159.el4rh)"

I did not fill in the "xxx triplet" fields above because it's not clear what you're asking for.
Comment 1 Pedro Alves 2013-04-17 14:26:48 UTC
Patch being proposed/discussed:

http://sourceware.org/ml/gdb-patches/2013-04/msg00459.html
Comment 2 Sourceware Commits 2013-04-24 14:29:19 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	mbilal@sourceware.org	2013-04-24 14:29:17

Modified files:
	gdb            : ChangeLog 
	gdb/cli        : cli-decode.c 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.base: setshow.exp 

Log message:
	2013-04-24  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-24  Muhammad Bilal  <mbilal@codesourcery.com>
	
	PR gdb/10462
	* gdb.base/setshow.exp: Add test case.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.15469&r2=1.15470
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/cli/cli-decode.c.diff?cvsroot=src&r1=1.118&r2=1.119
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3636&r2=1.3637
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/setshow.exp.diff?cvsroot=src&r1=1.29&r2=1.30
Comment 3 hmb 2013-04-24 14:37:51 UTC
I am closing this issue