This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

src/gdb ChangeLog windows-nat.c


CVSROOT:	/cvs/src
Module name:	src
Changes by:	brobecke@sourceware.org	2012-10-24 13:40:17

Modified files:
	gdb            : ChangeLog windows-nat.c 

Log message:
	[Windows] run program with space in path to exe.
	
	The following works...
	
	% gdb c:\path to exe\foo.exe
	(gdb) start
	
	... unless a file or directory called "c:\path" or "c:\path to" exist.
	This is what happens in the latter case:
	
	(gdb) start
	[...]
	Error creating process C:\path to exe\foo.exe (error 193).
	
	This is because we are calling CreateProcess (et al) without specifying
	the lpApplicationName, so Windows determines the name of the executable
	using the second argument, which is the entire command line.  This
	command line is a space-separated list of tokens, so the space in
	the path to the executable which potentially creates an ambiguity.
	The ambiguity is automatically resolved unless we're in the situation
	above.
	
	The solution, as suggested by the MSDN documentation for CreateProcess
	is to quote the executable name.
	
	gdb/ChangeLog:
	
	* windows-nat.c (windows_create_inferior) [!__CYGWIN__]:
	New local variable args_len.
	Quote the name of the executable when computing the command line.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14751&r2=1.14752
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/windows-nat.c.diff?cvsroot=src&r1=1.233&r2=1.234


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]