Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jtag
diff options
context:
space:
mode:
Diffstat (limited to 'jtag')
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/data/launch/src/x86_64.init1
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/src/org/eclipse/cdt/debug/gdbjtag/core/tests/launch/GDBJtagLaunchTest.java8
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$

Back to the top