1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-15 04:05:38 +02:00

[275193] Support for Remote Debugging tests using gdbserver

This commit is contained in:
Marc Khouzam 2009-10-27 15:09:42 +00:00
parent 84ac7856bc
commit 72a7fa5cd0
34 changed files with 267 additions and 1 deletions

View file

@ -68,8 +68,16 @@ public class BaseTestCase {
attrs.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, true);
attrs.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT);
attrs.put(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, ".gdbinit");
attrs.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN );
if (attrs.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE) == null) {
attrs.put(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE, ICDTLaunchConfigurationConstants.DEBUGGER_MODE_RUN );
}
// Set these up in case we will be running Remote tests. They will be ignored if we don't
attrs.put(ATTR_DEBUG_SERVER_NAME, "gdbserver.7.1");
attrs.put(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, true);
attrs.put(IGDBLaunchConfigurationConstants.ATTR_HOST, "localhost");
attrs.put(IGDBLaunchConfigurationConstants.ATTR_PORT, "9999");
}
@Before

View file

@ -0,0 +1,38 @@
/*******************************************************************************
* Copyright (c) 2009 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6.Suite_Remote_6_6;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7.Suite_Remote_6_7;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8.Suite_Remote_6_8;
import org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0.Suite_Remote_7_0;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
* This class is meant to be empty. It enables us to define
* the annotations which list all the different JUnit suites we
* want to run. When creating a new suite class, it should be
* added to the list below.
*
* This suite runs all the other suites.
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
Suite_Remote_6_6.class,
Suite_Remote_6_7.class,
Suite_Remote_6_8.class,
Suite_Remote_7_0.class,
/* Add your suite class here */
})
public class AllSuitesRemote {}

View file

@ -22,5 +22,6 @@ public class GDBProcessesTest_6_6 extends GDBProcessesTest {
@BeforeClass
public static void beforeClassMethod_6_6() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.6");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.6");
}
}

View file

@ -22,5 +22,6 @@ public class MIBreakpointsTest_6_6 extends MIBreakpointsTest {
@BeforeClass
public static void beforeClassMethod_6_6() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.6");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.6");
}
}

View file

@ -24,5 +24,6 @@ public class MIDisassemblyTest_6_6 extends MIDisassemblyTest {
@BeforeClass
public static void beforeClassMethod_6_6() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.6");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.6");
}
}

View file

@ -22,5 +22,6 @@ public class MIExpressionsTest_6_6 extends MIExpressionsTest {
@BeforeClass
public static void beforeClassMethod_6_6() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.6");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.6");
}
}

View file

@ -22,5 +22,6 @@ public class MIMemoryTest_6_6 extends MIMemoryTest {
@BeforeClass
public static void beforeClassMethod_6_6() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.6");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.6");
}
}

View file

@ -22,5 +22,6 @@ public class MIRegistersTest_6_6 extends MIRegistersTest {
@BeforeClass
public static void beforeClassMethod_6_6() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.6");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.6");
}
}

View file

@ -23,5 +23,6 @@ public class MIRunControlTest_6_6 extends MIRunControlTest {
@BeforeClass
public static void beforeClassMethod_6_6() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.6");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.6");
}
}

View file

@ -0,0 +1,48 @@
/*******************************************************************************
* Copyright (c) 2009 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_6;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
* This class is meant to be empty. It enables us to define
* the annotations which list all the different JUnit class we
* want to run. When creating a new test class, it should be
* added to the list below.
*
* This suite is for tests to be run with GDB 6.6
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
// We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256
MIRegistersTest_6_6.class,
MIRunControlTest_6_6.class,
MIExpressionsTest_6_6.class,
MIMemoryTest_6_6.class,
MIBreakpointsTest_6_6.class,
MIDisassemblyTest_6_6.class,
GDBProcessesTest_6_6.class
/* Add your test class here */
})
public class Suite_Remote_6_6 {
@BeforeClass
public static void beforeClassMethod() {
BaseTestCase.setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
}
}

View file

@ -22,5 +22,6 @@ public class GDBProcessesTest_6_7 extends GDBProcessesTest {
@BeforeClass
public static void beforeClassMethod_6_7() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.7");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.7");
}
}

View file

@ -22,5 +22,6 @@ public class MIBreakpointsTest_6_7 extends MIBreakpointsTest {
@BeforeClass
public static void beforeClassMethod_6_7() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.7");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.7");
}
}

View file

@ -24,5 +24,6 @@ public class MIDisassemblyTest_6_7 extends MIDisassemblyTest {
@BeforeClass
public static void beforeClassMethod_6_7() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.7");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.7");
}
}

View file

@ -22,5 +22,6 @@ public class MIExpressionsTest_6_7 extends MIExpressionsTest {
@BeforeClass
public static void beforeClassMethod_6_7() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.7");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.7");
}
}

View file

@ -22,5 +22,6 @@ public class MIMemoryTest_6_7 extends MIMemoryTest {
@BeforeClass
public static void beforeClassMethod_6_7() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.7");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.7");
}
}

View file

@ -22,5 +22,6 @@ public class MIRegistersTest_6_7 extends MIRegistersTest {
@BeforeClass
public static void beforeClassMethod_6_7() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.7");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.7");
}
}

View file

@ -23,5 +23,6 @@ public class MIRunControlTest_6_7 extends MIRunControlTest {
@BeforeClass
public static void beforeClassMethod_6_7() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.7");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.7");
}
}

View file

@ -0,0 +1,48 @@
/*******************************************************************************
* Copyright (c) 2009 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_7;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
* This class is meant to be empty. It enables us to define
* the annotations which list all the different JUnit class we
* want to run. When creating a new test class, it should be
* added to the list below.
*
* This suite is for tests to be run with GDB 6.7
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
// We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256
MIRegistersTest_6_7.class,
MIRunControlTest_6_7.class,
MIExpressionsTest_6_7.class,
MIMemoryTest_6_7.class,
MIBreakpointsTest_6_7.class,
MIDisassemblyTest_6_7.class,
GDBProcessesTest_6_7.class
/* Add your test class here */
})
public class Suite_Remote_6_7 {
@BeforeClass
public static void beforeClassMethod() {
BaseTestCase.setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
}
}

View file

@ -22,5 +22,6 @@ public class GDBProcessesTest_6_8 extends GDBProcessesTest {
@BeforeClass
public static void beforeClassMethod_6_8() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.8");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.8");
}
}

View file

@ -22,5 +22,6 @@ public class MIBreakpointsTest_6_8 extends MIBreakpointsTest {
@BeforeClass
public static void beforeClassMethod_6_8() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.8");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.8");
}
}

View file

@ -24,5 +24,6 @@ public class MIDisassemblyTest_6_8 extends MIDisassemblyTest {
@BeforeClass
public static void beforeClassMethod_6_8() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.8");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.8");
}
}

View file

@ -22,5 +22,6 @@ public class MIExpressionsTest_6_8 extends MIExpressionsTest {
@BeforeClass
public static void beforeClassMethod_6_8() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.8");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.8");
}
}

View file

@ -22,5 +22,6 @@ public class MIMemoryTest_6_8 extends MIMemoryTest {
@BeforeClass
public static void beforeClassMethod_6_8() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.8");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.8");
}
}

View file

@ -22,5 +22,6 @@ public class MIRegistersTest_6_8 extends MIRegistersTest {
@BeforeClass
public static void beforeClassMethod_6_8() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.8");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.8");
}
}

View file

@ -23,5 +23,6 @@ public class MIRunControlTest_6_8 extends MIRunControlTest {
@BeforeClass
public static void beforeClassMethod_6_8() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.6.8");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.6.8");
}
}

View file

@ -0,0 +1,48 @@
/*******************************************************************************
* Copyright (c) 2009 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_6_8;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
* This class is meant to be empty. It enables us to define
* the annotations which list all the different JUnit class we
* want to run. When creating a new test class, it should be
* added to the list below.
*
* This suite is for tests to be run with GDB 6.8
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
// We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256
MIRegistersTest_6_8.class,
MIRunControlTest_6_8.class,
MIExpressionsTest_6_8.class,
MIMemoryTest_6_8.class,
MIBreakpointsTest_6_8.class,
MIDisassemblyTest_6_8.class,
GDBProcessesTest_6_8.class
/* Add your test class here */
})
public class Suite_Remote_6_8 {
@BeforeClass
public static void beforeClassMethod() {
BaseTestCase.setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
}
}

View file

@ -22,5 +22,6 @@ public class GDBProcessesTest_7_0 extends GDBProcessesTest {
@BeforeClass
public static void beforeClassMethod_7_0() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.7.0");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.7.0");
}
}

View file

@ -22,5 +22,6 @@ public class MIBreakpointsTest_7_0 extends MIBreakpointsTest {
@BeforeClass
public static void beforeClassMethod_7_0() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.7.0");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.7.0");
}
}

View file

@ -24,5 +24,6 @@ public class MIDisassemblyTest_7_0 extends MIDisassemblyTest {
@BeforeClass
public static void beforeClassMethod_7_0() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.7.0");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.7.0");
}
}

View file

@ -22,5 +22,6 @@ public class MIExpressionsTest_7_0 extends MIExpressionsTest {
@BeforeClass
public static void beforeClassMethod_7_0() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.7.0");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.7.0");
}
}

View file

@ -22,5 +22,6 @@ public class MIMemoryTest_7_0 extends MIMemoryTest {
@BeforeClass
public static void beforeClassMethod_7_0() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.7.0");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.7.0");
}
}

View file

@ -22,5 +22,6 @@ public class MIRegistersTest_7_0 extends MIRegistersTest {
@BeforeClass
public static void beforeClassMethod_7_0() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.7.0");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.7.0");
}
}

View file

@ -23,5 +23,6 @@ public class MIRunControlTest_7_0 extends MIRunControlTest {
@BeforeClass
public static void beforeClassMethod_7_0() {
BaseTestCase.setLaunchAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, "gdb.7.0");
BaseTestCase.setLaunchAttribute(ATTR_DEBUG_SERVER_NAME, "gdbserver.7.0");
}
}

View file

@ -0,0 +1,48 @@
/*******************************************************************************
* Copyright (c) 2009 Ericsson and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Ericsson - Initial Implementation
*******************************************************************************/
package org.eclipse.cdt.tests.dsf.gdb.tests.tests_7_0;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
import org.eclipse.cdt.dsf.gdb.IGDBLaunchConfigurationConstants;
import org.eclipse.cdt.tests.dsf.gdb.framework.BaseTestCase;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
/**
* This class is meant to be empty. It enables us to define
* the annotations which list all the different JUnit class we
* want to run. When creating a new test class, it should be
* added to the list below.
*
* This suite is for tests to be run with GDB 7.0
*/
@RunWith(Suite.class)
@Suite.SuiteClasses({
// We need specific name for the tests of this suite, because of bug https://bugs.eclipse.org/172256
MIRegistersTest_7_0.class,
MIRunControlTest_7_0.class,
MIExpressionsTest_7_0.class,
MIMemoryTest_7_0.class,
MIBreakpointsTest_7_0.class,
MIDisassemblyTest_7_0.class,
GDBProcessesTest_7_0.class
/* Add your test class here */
})
public class Suite_Remote_7_0 {
@BeforeClass
public static void beforeClassMethod() {
BaseTestCase.setLaunchAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
}
}