Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316609 - Need to escape special characters in binary path
Summary: Need to escape special characters in binary path
Status: RESOLVED FIXED
Alias: None
Product: Linux Tools
Classification: Tools
Component: Call Graph (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 1.0   Edit
Assignee: Roland Grunberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-11 09:48 EDT by Andrew Overholt CLA
Modified: 2012-04-19 11:09 EDT (History)
2 users (show)

See Also:


Attachments
Patch for 316609 (3.11 KB, text/plain)
2010-06-11 11:20 EDT, Charley Wang CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Overholt CLA 2010-06-11 09:48:16 EDT
I have a simple hello world C++ autotools project and the binary ends up having a "(GNU)" in its path.  It appears that we need to escape elements like parentheses in the generated shell script:

/tmp/org.eclipse.linuxtools.profiling.launch12762638928466417352370768374524.sh: line 2: syntax error near unexpected token `('
/tmp/org.eclipse.linuxtools.profiling.launch12762638928466417352370768374524.sh: line 2: `exec stap -o /tmp/testRC2/.metadata/.plugins/org.eclipse.linuxtools.callgraph.core/callgraph.out -c '/tmp/testRC2/AutotoolsProject/build-Build_(GNU)/src/a.out' /tmp/testRC2/.metadata/.plugins/org.eclipse.linuxtools.callgraph.core/callgraphGen.stp /tmp/testRC2/AutotoolsProject/build-Build_(GNU)/src/a.out'
Comment 1 Charley Wang CLA 2010-06-11 11:20:57 EDT
Created attachment 171735 [details]
Patch for 316609

Roland and I drafted a patch for this in Callgraph. Unfortunately we can't apply to Profiling directly, since Profiling doesn't distinguish between regular parameters and file paths. This quick fix just properly escapes (, ) and spaces in the binary and output paths.

Also, projects containing names with special characters currently don't seem to compile on CDT or AutoTools without manual tweaking, so I did this to reproduce:

1. Create C++ Autotools project named "test (316609)"
2. Rename cpp file to test316609.cpp
3. In Makefile, change the object file name to test316609

This allowed the CDT to finish building/compiling.
Comment 2 Alexander Kurtakov CLA 2012-04-19 03:46:22 EDT
Roland, Please review and apply or close the bug if it's not relevant anymore
Comment 3 Roland Grunberg CLA 2012-04-19 11:09:29 EDT
I've confirmed this fixes the issue and committed as f5ed5563795f387f22c25c3a1d3146569aa74c9f. The initial contribution was made to be specifically contributed to Callgraph under the EPL, by a former committer, and is < 250 loc. Resolving as fixed.