Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 284573

Summary: [launch] Default Launchers preference settings have no effect when using launch shortcut to initiate debugging
Product: [Tools] CDT Reporter: Mario Pierro <mario.pierro>
Component: cdt-debug-dsfAssignee: Marc Khouzam <marc.khouzam>
Status: RESOLVED FIXED QA Contact: Pawel Piech <pawel.1.piech>
Severity: normal    
Priority: P3 CC: marc.khouzam, pawel.1.piech
Version: 6.0Flags: pawel.1.piech: review+
Target Milestone: 7.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix marc.khouzam: iplog-

Description Mario Pierro CLA 2009-07-24 09:18:10 EDT
Build ID: 20090619-0625

Steps To Reproduce:
1. Start the eclipse-cpp-galileo-win32 distribution on a blank workspace

2. Set a default launcher for preference for C/C++ Application in Window >
Preferences > Run/Debug > Launching > Default Launchers > C/C++ Application >
Debug > GDB (DSF) Create Process Launcher

3. Create a new C project using the "Hello World" template (on Windows, either MinGW or Cygwin toolchains can be used)

4. Click on the Debug button to initiate debugging immediately using a launch shortcut

5. The debugging session will be started using the Standard Process Launcher. This can be verified by examining the launch configuration created by the launch shortcut in the Debug Configuration dialog. If the same dialog is used to create a launch configuration from scratch, that will be initialized correctly.


More information:
Another problem with launcher preferences has been reported in bug 284557
Comment 1 Marc Khouzam CLA 2010-05-13 22:31:21 EDT
This is an interesting problem.  I ran into the same thing in  Bug 304384 comment #6.  Fixing it for the launch shortcut is not as obvious.  I'll have to think about it.
Comment 2 Marc Khouzam CLA 2010-05-13 22:45:35 EDT
Created attachment 168498 [details]
Fix

Well, it turned out to be much easier than I feared.
(The debug platform is really good)

Committed to HEAD.
Comment 3 Marc Khouzam CLA 2010-05-13 22:47:19 EDT
Pawel, can you review this two-line fix?
The solution is to not only check the preferred launch delegate of the launch configuration, but to also check if there is a preferred launch delegate for the launch configuration type.  Only if both are not set should we force a default ourselves.
Comment 4 Mario Pierro CLA 2010-05-19 11:06:00 EDT
This works nicely now, thank you.

Having bug 284557 fixed should also avoid the hassle of having to go through the "Select launch delegate" dialog.
Comment 5 Marc Khouzam CLA 2010-05-19 11:52:39 EDT
(In reply to comment #4)
> This works nicely now, thank you.

Great!

> Having bug 284557 fixed should also avoid the hassle of having to go through
> the "Select launch delegate" dialog.

I've just committed the fix to  Bug 312997 which I believe much improves our use of the launch delegates.  There is not real user-visible change, except that the preferred launch delegate global preference will always be set.
Comment 6 Pawel Piech CLA 2010-05-19 12:46:59 EDT
Having just looked at bug 284557, this makes perfect sense.
Comment 7 CDT Genie CLA 2010-07-28 15:27:34 EDT
*** cdt cvs genie on behalf of mkhouzam ***
Bug 284573: Do force a preferred launch delegate if the configuration type already has one (which is set in the global preference for preferred launch delegate)

[*] CApplicationLaunchShortcut.java 1.6 http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.cdt/all/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java?root=Tools_Project&r1=1.5&r2=1.6