From 5028a943965489e321cc3701e8d44e1de7f5bafd Mon Sep 17 00:00:00 2001 From: Marc Khouzam Date: Wed, 24 Jun 2015 15:53:02 -0400 Subject: [PATCH] Disable restart test in case of remote debugging Change-Id: I08310791fe23c31219ea0e6ae26ea7f0a14eeff7 Signed-off-by: Marc Khouzam --- .../cdt/tests/dsf/gdb/framework/BaseTestCase.java | 5 ++--- .../cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java | 10 +++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java index d3826ad04b1..48eeba7571e 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseTestCase.java @@ -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); diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java index 4cd012c55d3..80809b2ba03 100644 --- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java +++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/MIBreakpointsTest.java @@ -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));