diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF index b1872fb771a..a0683bf3605 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core.tests;singleton:=true -Bundle-Version: 1.0.200.qualifier +Bundle-Version: 1.0.300.qualifier Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.tests.Activator Require-Bundle: org.eclipse.core.runtime, org.eclipse.cdt.tests.dsf.gdb;bundle-version="2.3.0", diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml index aa78ea437c2..7fee58882d7 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - 1.0.200-SNAPSHOT + 1.0.300-SNAPSHOT org.eclipse.cdt.debug.gdbjtag.core.tests eclipse-test-plugin diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java index 28f55f2239e..027eb33949f 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2019 Kichwa Coders Ltd and others. + * Copyright (c) 2016, 2021 Kichwa Coders Ltd and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -11,11 +11,14 @@ * Contributors: * Jonah Graham (Kichwa Coders) - base API and implementation * John Dallaway - GDB JTAG implementation (bug 538282) + * John Dallaway - Set preferred launch delegate (bug 570018) *******************************************************************************/ package org.eclipse.cdt.debug.gdbjtag.core.tests.launch; import static org.junit.Assert.assertFalse; +import java.util.Set; + import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants; import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; @@ -24,15 +27,16 @@ import org.eclipse.cdt.dsf.gdb.launching.LaunchUtils; import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory; import org.eclipse.cdt.tests.dsf.gdb.framework.BaseParametrizedTestCase; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.debug.core.ILaunchManager; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; @RunWith(Parameterized.class) -@SuppressWarnings("restriction") public class GDBJtagLaunchTest extends BaseParametrizedTestCase { private static final String TEST_LAUNCH_CONFIGURATION_TYPE_ID = "org.eclipse.cdt.debug.gdbjtag.launchConfigurationType"; //$NON-NLS-1$ + private static final String TEST_LAUNCH_DELEGATE_ID = "org.eclipse.cdt.debug.gdbjtag.core.dsfLaunchDelegate"; //$NON-NLS-1$ private static final String TEST_JTAG_DEVICE_ID = "org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.genericDevice"; //$NON-NLS-1$ private static final String TEST_PROGRAM_NAME = EXEC_PATH + "Minimal.exe"; //$NON-NLS-1$ private static final String X86_64_INIT = SOURCE_PATH + "x86_64.init"; //$NON-NLS-1$ @@ -63,7 +67,7 @@ public class GDBJtagLaunchTest extends BaseParametrizedTestCase { setLaunchAttribute(IGDBJtagConstants.ATTR_USE_PROJ_BINARY_FOR_SYMBOLS, true); if (0 > LaunchUtils.compareVersions(getGdbVersion(), GdbDebugServicesFactory.GDB_7_10_VERSION)) { // Use a GDB initialization file to set x86_64 architecture for remote sessions with older GDB. - // This much precede connection to the gdbserver so we cannot use IGDBJtagConstants.ATTR_INIT_COMMANDS. + // This must precede connection to the gdbserver so we cannot use IGDBJtagConstants.ATTR_INIT_COMMANDS. setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, X86_64_INIT); } } else { @@ -75,8 +79,9 @@ public class GDBJtagLaunchTest extends BaseParametrizedTestCase { @Override protected GdbLaunch doLaunchInner() throws Exception { + final ILaunchConfigurationWorkingCopy wc = getLaunchConfiguration().getWorkingCopy(); + wc.setPreferredLaunchDelegate(Set.of(ILaunchManager.DEBUG_MODE), TEST_LAUNCH_DELEGATE_ID); if (remote) { - final ILaunchConfigurationWorkingCopy wc = getLaunchConfiguration().getWorkingCopy(); // copy host from IGDBLaunchConfigurationConstants.ATTR_HOST to IGDBJtagConstants.ATTR_IP_ADDRESS final Object host = getLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST); wc.setAttribute(IGDBJtagConstants.ATTR_IP_ADDRESS, host); @@ -85,8 +90,8 @@ public class GDBJtagLaunchTest extends BaseParametrizedTestCase { if (port instanceof String) { wc.setAttribute(IGDBJtagConstants.ATTR_PORT_NUMBER, Integer.valueOf((String) port)); } - wc.doSave(); } + wc.doSave(); return super.doLaunchInner(); }