diff options
author | John Dallaway | 2018-09-07 15:47:19 +0000 |
---|---|---|
committer | John Dallaway | 2018-09-07 15:48:37 +0000 |
commit | 6870f55fbb436f47f3b7353baf53f77f9f5c2f54 (patch) | |
tree | 30d508f355a482355230ff837e127b1579915e3a /jtag | |
parent | 92bdc049a299b366e06c2fb722c89d76ffb1c37f (diff) | |
download | org.eclipse.cdt-6870f55fbb436f47f3b7353baf53f77f9f5c2f54.tar.gz org.eclipse.cdt-6870f55fbb436f47f3b7353baf53f77f9f5c2f54.tar.xz org.eclipse.cdt-6870f55fbb436f47f3b7353baf53f77f9f5c2f54.zip |
Bug 538282: Set architecture for remote GDBJtag tests
Change-Id: I0e4e8a345bd5c63116efff2a6b140500f0b77328
Signed-off-by: John Dallaway <john@dallaway.org.uk>
Diffstat (limited to 'jtag')
2 files changed, 9 insertions, 0 deletions
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/data/launch/src/x86_64.init b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/data/launch/src/x86_64.init new file mode 100644 index 00000000000..c0f4fa2ddfb --- /dev/null +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/data/launch/src/x86_64.init @@ -0,0 +1 @@ +set architecture i386:x86-64 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 18e354ef2ab..991b72f169d 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 @@ -17,6 +17,8 @@ import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.gdbjtag.core.IGDBJtagConstants; import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants; import org.eclipse.cdt.dsf.gdb.launching.GdbLaunch; +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.junit.Test; @@ -32,6 +34,7 @@ public class GDBJtagLaunchTest extends BaseParametrizedTestCase { 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$ @Test public void testGdbJtagLaunch() { @@ -56,6 +59,11 @@ public class GDBJtagLaunchTest extends BaseParametrizedTestCase { setLaunchAttribute(IGDBJtagConstants.ATTR_SET_RESUME, remote); if (remote) { 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. + setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, X86_64_INIT); + } } else { setLaunchAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, "file " + TEST_PROGRAM_NAME); //$NON-NLS-1$ setLaunchAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, "run"); //$NON-NLS-1$ |