Bug 191332 - Unable to debug project with spaces in project name
Summary: Unable to debug project with spaces in project name
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-06 14:42 EDT by Eric Hildum CLA
Modified: 2020-09-04 15:26 EDT (History)
7 users (show)

See Also:


Attachments
Use URIUtil to encode the URI before adding it to the base URI (2.02 KB, patch)
2011-12-07 16:33 EST, Dries Harnie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Hildum CLA 2007-06-06 14:42:06 EDT
Build ID: eclipse.buildId=I20070517-1700

Steps To Reproduce:
1. Create managed build project with name "Hello Japan"
2. Create sample application Hello World and build
3. Set breakpoint and attempt to start debugging

Expected result
Debugging session starts

Actual result:
Error message (log below).


More information:
eclipse.buildId=I20070517-1700
java.version=1.6.0_01
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -startup C:\Program Files\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070516.jar
Command-line arguments:  -os win32 -ws win32 -arch x86 -startup C:\Program Files\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070516.jar

Error
Wed Jun 06 11:37:50 PDT 2007
Failed to set program arguments, environment or working directory.

org.eclipse.cdt.debug.core.cdi.CDIException: Unable to set working directory: "D:\\Profiles\\xfq473\\workspace\\Hello Japan": Invalid argument.[]
at org.eclipse.cdt.debug.mi.core.cdi.model.RuntimeOptions.setWorkingDirectory(RuntimeOptions.java:108)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.setRuntimeOptions(LocalCDILaunchDelegate.java:418)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchLocalDebugSession(LocalCDILaunchDelegate.java:141)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launchDebugger(LocalCDILaunchDelegate.java:105)
at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.launch(LocalCDILaunchDelegate.java:65)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:766)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:608)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:899)
at org.eclipse.debug.internal.ui.DebugUIPlugin$7.run(DebugUIPlugin.java:1102)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Comment 1 Doug Schaefer CLA 2007-06-06 14:59:43 EDT
Our handling of spaces in filenames has been weak, mainly because very few C/C++ developers do that (I guess they all have Unix backgrounds).

We should address this accross the board, though.
Comment 2 Eric Hildum CLA 2007-06-20 17:51:18 EDT
As part of this review, the code should be tested for support of non-ASCII file names, e.g., 日本語.c
Comment 3 Eric Hildum CLA 2007-06-20 17:52:22 EDT
Well, it appears that we also need to upgrade Bugzilla. The example was a file name in Japanese.
Comment 4 Jean-Philippe Fleury CLA 2011-02-02 18:29:59 EST
I confirm this bug with Eclipse 3.5.2 on Ubuntu 10.10.
Comment 5 Dries Harnie CLA 2011-12-07 16:29:59 EST
I get a different error, both when building and debugging.

java.lang.IllegalArgumentException
	at java.net.URI.create(URI.java:859)
	at java.net.URI.resolve(URI.java:1045)
	at org.eclipse.cdt.managedbuilder.internal.core.AdditionalInput.getArtifactTimeStamp(AdditionalInput.java:383)
	at org.eclipse.cdt.managedbuilder.internal.core.AdditionalInput.needsRebuild(AdditionalInput.java:344)
	at org.eclipse.cdt.managedbuilder.internal.core.InputType.needsRebuild(InputType.java:1671)
	at org.eclipse.cdt.managedbuilder.internal.core.Tool.needsRebuild(Tool.java:3382)
	at org.eclipse.cdt.managedbuilder.internal.core.ToolChain.needsRebuild(ToolChain.java:2106)
	at org.eclipse.cdt.managedbuilder.internal.core.FolderInfo.needsRebuild(FolderInfo.java:346)
	at org.eclipse.cdt.managedbuilder.internal.core.Configuration.needsRebuild(Configuration.java:1733)
	at org.eclipse.cdt.managedbuilder.internal.core.Configuration.needsRebuild(Configuration.java:1716)
<snip>
Caused by: java.net.URISyntaxException: Illegal character in path at index 5: Hello Japan
	at java.net.URI$Parser.fail(URI.java:2825)
	at java.net.URI$Parser.checkChars(URI.java:2998)
	at java.net.URI$Parser.parseHierarchical(URI.java:3082)
	at java.net.URI$Parser.parse(URI.java:3040)
	at java.net.URI.<init>(URI.java:595)
	at java.net.URI.create(URI.java:857)
	... 34 more
Comment 6 Dries Harnie CLA 2011-12-07 16:33:32 EST
Created attachment 208073 [details]
Use URIUtil to encode the URI before adding it to the base URI

This patch fixes the URI error. I can now create a new project with spaces, run and debug without errors.
Comment 7 Andrew Overholt CLA 2011-12-08 08:45:57 EST
I was once told by a professor that the first thing he does when teaching students C programming (using the CDT) is to not put spaces in their project names.  It would be great if this were fixed :)
Comment 8 Dries Harnie CLA 2011-12-08 09:03:26 EST
That is in fact the exact reason why I'm fixing this bug, as I also teach C++ using the CDT :)
Comment 9 Richard Horbach CLA 2012-05-09 11:26:55 EDT
Note that the issue referred to in comment #5 was introduced fairly recently in CDT 8.0.2. In CDT 8.0.2 the failing method org.eclipse.cdt.managedbuilder.internal.core.AdditionalInput.getArtifactTimeStamp(IToolChain) was introduced.
Comment 10 Marc-André Laperle CLA 2012-05-09 13:21:02 EDT
(In reply to comment #9)
> Note that the issue referred to in comment #5 was introduced fairly recently in
> CDT 8.0.2. In CDT 8.0.2 the failing method
> org.eclipse.cdt.managedbuilder.internal.core.AdditionalInput.getArtifactTimeStamp(IToolChain)
> was introduced.

(In reply to comment #9)
> Note that the issue referred to in comment #5 was introduced fairly recently in
> CDT 8.0.2. In CDT 8.0.2 the failing method
> org.eclipse.cdt.managedbuilder.internal.core.AdditionalInput.getArtifactTimeStamp(IToolChain)
> was introduced.

That one is now fixed in 8.1.0, see Bug 377295.