diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF index ce222d61207..cee554fa5aa 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: GDB Hardware Debugging Tests Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core.tests;singleton:=true -Bundle-Version: 1.0.0.qualifier +Bundle-Version: 1.0.100.qualifier Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.tests.Activator Require-Bundle: org.eclipse.core.runtime, org.eclipse.cdt.tests.dsf.gdb;bundle-version="2.3.0", diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml index 3433133ec3c..673110bb578 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core.tests/pom.xml @@ -11,7 +11,7 @@ ../../pom.xml - 1.0.0-SNAPSHOT + 1.0.100-SNAPSHOT org.eclipse.cdt.debug.gdbjtag.core.tests eclipse-test-plugin 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 05167246fdf..9281bb5fc20 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2016, 2018 Kichwa Coders and others. + * Copyright (c) 2016, 2019 Kichwa Coders and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -67,8 +67,9 @@ public class GDBJtagLaunchTest extends BaseParametrizedTestCase { 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$ + String comments = "# Commented line\n\n \n # Commented indented line\n"; + setLaunchAttribute(IGDBJtagConstants.ATTR_INIT_COMMANDS, comments + "file " + TEST_PROGRAM_NAME); //$NON-NLS-1$ + setLaunchAttribute(IGDBJtagConstants.ATTR_RUN_COMMANDS, comments + "run"); //$NON-NLS-1$ } } diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java index 59f169e6ed8..89c623f0640 100644 --- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java +++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence.java @@ -489,6 +489,11 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { if (userCmd.length() > 0) { String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$ + // Remove empty or commented lines + commands = Arrays.stream(commands) + .filter(line -> !line.trim().isEmpty() && !line.trim().startsWith("#")) //$NON-NLS-1$ + .toArray(String[]::new); + CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm); crm.setDoneCount(commands.length); for (int i = 0; i < commands.length; ++i) { @@ -715,6 +720,11 @@ public class GDBJtagDSFFinalLaunchSequence extends FinalLaunchSequence { userCmd = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(userCmd); String[] commands = userCmd.split("\\r?\\n"); //$NON-NLS-1$ + // Remove empty or commented lines + commands = Arrays.stream(commands) + .filter(line -> !line.trim().isEmpty() && !line.trim().startsWith("#")) //$NON-NLS-1$ + .toArray(String[]::new); + CountingRequestMonitor crm = new CountingRequestMonitor(getExecutor(), rm); crm.setDoneCount(commands.length); for (int i = 0; i < commands.length; ++i) {