Disable restart test in case of remote debugging
authorMarc Khouzam <marc.khouzam@ericsson.com>
Wed, 24 Jun 2015 19:53:02 +0000 (15:53 -0400)
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>
Fri, 17 Jul 2015 12:16:17 +0000 (08:16 -0400)
Change-Id: I08310791fe23c31219ea0e6ae26ea7f0a14eeff7
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java
dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java

index d3826ad..48eeba7 100644 (file)
@@ -303,7 +303,7 @@ public class BaseTestCase {
      * Launch GDB.  The launch attributes must have been set already.
      */
        protected void doLaunch() throws Exception {
-               boolean remote = launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE).equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
+               boolean remote = isRemoteSession();
                
        if (GdbDebugOptions.DEBUG) {
                GdbDebugOptions.trace("===============================================================================================\n");
@@ -394,8 +394,7 @@ public class BaseTestCase {
                        return;
                }
 
-               if (launchAttributes.get(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE)
-                                             .equals(IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE)) {
+               if (isRemoteSession()) {
                        if (launchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP).equals(Boolean.TRUE)) {
                                String server = (String)launchAttributes.get(ATTR_DEBUG_SERVER_NAME);
                                String port = (String)launchAttributes.get(IGDBLaunchConfigurationConstants.ATTR_PORT);
index 4cd012c..80809b2 100644 (file)
@@ -64,6 +64,7 @@ import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
 import org.eclipse.debug.core.DebugPlugin;
 import org.eclipse.debug.core.IBreakpointManager;
 import org.eclipse.debug.core.model.IBreakpoint;
+import org.junit.Assert;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -2843,7 +2844,14 @@ public class MIBreakpointsTest extends BaseTestCase {
        // ------------------------------------------------------------------------
        @Test
        public void updateBreakpoint_AfterRestart() throws Throwable {
-               try {
+       // Restart is not supported for a remote session
+       if (isRemoteSession()) {
+               Assert.assertFalse("Restart operation should not be allowed for a remote session",
+                                          SyncUtil.canRestart());
+           return;
+       }
+
+       try {
                        // Create a line breakpoint in the platform.  To do that, create a bp from
                        // the gdb console and let CDT create the corresponding platform bp.
                        queueConsoleCommand(String.format("break %s:%d", SOURCE_NAME, LINE_NUMBER_5));