Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Setting a default launch delegate in a product in the Default Launchers preference page

Hello,

I am trying to set a default launch delegate for our debugger, so that
users will not need to explicitly set one in preferences (Run/Debug >
Launching > Default Launchers).

In my plugin_customization.ini, I am adding an entry which refers to my
launch delegate ID

org.eclipse.debug.core/org.eclipse.debug.core.PREFERRED_DELEGATES/org.ec
lipse.cdt.launch.applicationLaunchType=<my own launch delegate ID
here>,debug

However, this specific default setting seems to be ignored when the
preferences page is initialized in my product.

The preference key is formed as described in the class

org.eclipse.debug.internal.core.LaunchManager 

so that it is org.eclipse.debug.core.PREFERRED_DELEGATES followed by a
slash and the launch configuration type id.

I have looked through bug 262826

https://bugs.eclipse.org/bugs/show_bug.cgi?id=262826

However, by debugging through

org.eclipse.core.internal.preferences.DefaultPreferences

I have noticed that in the applyDefaults() method, line 133:


	private void applyDefaults(String id, Properties defaultValues,
Properties translations) {
		for (Enumeration e = defaultValues.keys();
e.hasMoreElements();) {
			String fullKey = (String) e.nextElement();
			String value =
defaultValues.getProperty(fullKey);
			if (value == null)
				continue;
			IPath childPath = new Path(fullKey);
	here>>>>	String key = childPath.lastSegment();
			childPath = childPath.removeLastSegments(1);
			.
			.
			.



the key gets set to the id of the launch configuration type 

org.eclipse.cdt.launch.applicationLaunchType

while the childPath is

org.eclipse.debug.core/org.eclipse.debug.core.PREFERRED_DELEGATES

because of the call to lastSegment()

Might this cause the key which is set afterwards in the code to be
incorrect?

If so, how does CDT default to the CDI debugger launch? There seems to
be no preferred launch delegate selected by default.

Am I missing something?

Thanks for your help!

/Mario






Back to the top