Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 510615 - Launch dialog,handle spaces in GDB path, with browse button
Summary: Launch dialog,handle spaces in GDB path, with browse button
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: Next   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 9.2.1   Edit
Assignee: Marc Dumais CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on: 458499
Blocks:
  Show dependency tree
 
Reported: 2017-01-18 04:11 EST by Vincent Guignot CLA
Modified: 2017-02-07 13:29 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Guignot CLA 2017-01-18 04:11:52 EST
I'm using Eclipse 4.6.2 with CDT 9.2. When trying to debug a hello world binary on my computer, if I use a GDB located in a path with spaces, Gdb fails:
Error with command: /tmp/dir spaces/gdb --version
Cannot run program "/tmp/dir": Unknown reason

If I add double quotes on the path from the UI, It works.
Comment 1 Marc Dumais CLA 2017-01-23 10:21:30 EST
Salut Vincent,

I can confirm that I see the launch failing, in the case where there is a space in GDB's path. As reported, it works if the path is surrounded by double-quotes, in the launch configuration

However, reading the following discussion, it seems that this behavior (having to use the double-quotes around the path when spaces are present, was intended: 
https://bugs.eclipse.org/bugs/show_bug.cgi?id=458499

I think we missed Elena's suggestion ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=458499#c9 ) , to have the launch configuration add the double quotes around GDB's path when it contains a space, when the user uses the "browse" button to set the path. I think that at least this way, the user can "learn" how to format the path, by looking how CDT does it. 

Thoughts?
Comment 2 Vincent Guignot CLA 2017-01-23 10:30:25 EST
Bonjour Marc,
I agree. I've read the Elena suggestion, but didn't find anything in the code about that. I think this is the good way. 


By the way, I don't understand why it still working in win32 without quotes.
Comment 3 Marc Dumais CLA 2017-01-23 13:45:47 EST
Salut Vincent,

I'd like to get your opinion. I have a patch that makes the situation better, when the user uses the "Browser" button to select the path to GDB (based Alena's suggestion). 

However, I think we could keep the current bug, since the problem still happens when the user enters the path manually or pastes it from somewhere else. So I could create a new bug, for my fix, linking to this one here in the description. Else I could rephrase the current bug to reflect what was improved.

What do you think?

Thanks,

Marc
Comment 4 Eclipse Genie CLA 2017-01-23 14:17:44 EST
New Gerrit change created: https://git.eclipse.org/r/89388
Comment 5 Vincent Guignot CLA 2017-01-24 02:13:57 EST
Marc, you can use this bugzilla number. No troubles. Thanks for your work.
Comment 7 Marc Khouzam CLA 2017-02-07 09:58:56 EST
Do you want this in 9.2.1?
Comment 8 Vincent Guignot CLA 2017-02-07 10:02:18 EST
Bonjour,

Why not, I can wait for the 9.3, if it's too risky.

Thanks for your work !
Comment 9 Eclipse Genie CLA 2017-02-07 12:47:12 EST
New Gerrit change created: https://git.eclipse.org/r/90568