Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jtag
diff options
context:
space:
mode:
authorAlvaro Sanchez-Leon2017-01-09 11:42:22 -0500
committerAlvaro Sanchez-Leon2017-01-17 12:37:49 -0500
commit2e780a54f11e730e20ba0974d2ce3d64873d6087 (patch)
treee923fcd9fc91da2ce1235d78d54525510b2d1db0 /jtag
parent028eb67a17b5546681eb7785a6c7febca776d46c (diff)
downloadorg.eclipse.cdt-2e780a54f11e730e20ba0974d2ce3d64873d6087.tar.gz
org.eclipse.cdt-2e780a54f11e730e20ba0974d2ce3d64873d6087.tar.xz
org.eclipse.cdt-2e780a54f11e730e20ba0974d2ce3d64873d6087.zip
Bug 509812 - Unable to interrupt arm remote target, Neon and GDB 7.12
Adding a GDBJtagDSFFinalLaunchSequence_7_12 class to be used when interfacing with GDB 7.12 or higher. A new step is added to the sequence in order to enable async mode, which will allow us to use the new GDBFullCLIConsole Change-Id: I08c382550c6dd8a8567a66169495a9e490c35397
Diffstat (limited to 'jtag')
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/.settings/.api_filters10
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/pom.xml2
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java77
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_12.java36
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GdbJtagDebugServicesFactory.java5
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/extensions/GDBJtagControl_HEAD.java8
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java8
8 files changed, 140 insertions, 8 deletions
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/.settings/.api_filters b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.settings/.api_filters
new file mode 100644
index 0000000000..697d224199
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/.settings/.api_filters
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.cdt.debug.gdbjtag.core" version="2">
+ <resource path="src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/extensions/GDBJtagControl_HEAD.java" type="org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.extensions.GDBJtagControl_HEAD">
+ <filter comment="This change is understood and will not break the API" id="338849923">
+ <message_arguments>
+ <message_argument value="org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.extensions.GDBJtagControl_HEAD"/>
+ </message_arguments>
+ </filter>
+ </resource>
+</component>
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF b/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
index 6d887cc46e..9bef93d836 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.gdbjtag.core;singleton:=true
-Bundle-Version: 9.0.0.qualifier
+Bundle-Version: 9.1.0.qualifier
Bundle-Activator: org.eclipse.cdt.debug.gdbjtag.core.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/pom.xml b/jtag/org.eclipse.cdt.debug.gdbjtag.core/pom.xml
index 349345bba5..5e30f1740f 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/pom.xml
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/pom.xml
@@ -11,7 +11,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>
- <version>9.0.0-SNAPSHOT</version>
+ <version>9.1.0-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.debug.gdbjtag.core</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java
new file mode 100644
index 0000000000..f6b05b7613
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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
+ *******************************************************************************/
+package org.eclipse.cdt.debug.gdbjtag.core;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
+import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
+import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress;
+import org.eclipse.cdt.dsf.mi.service.IMICommandControl;
+import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
+import org.eclipse.cdt.dsf.service.DsfServicesTracker;
+import org.eclipse.cdt.dsf.service.DsfSession;
+
+/**
+ * Subclass for GDB >= 7.12.
+ *
+ * @since 9.1
+ */
+public class GDBJtagDSFFinalLaunchSequence_7_12 extends GDBJtagDSFFinalLaunchSequence_7_7 {
+ public GDBJtagDSFFinalLaunchSequence_7_12(DsfSession session, Map<String, Object> attributes,
+ RequestMonitorWithProgress rm) {
+ super(session, attributes, rm);
+ }
+
+ @Override
+ protected String[] getExecutionOrder(String group) {
+ if (GROUP_TOP_LEVEL.equals(group)) {
+ // Initialize the list with the steps from the base class
+ List<String> orderList = new ArrayList<String>(
+ Arrays.asList(super.getExecutionOrder(GROUP_TOP_LEVEL)));
+
+ // Add the new step after we source the gdbinit file to make sure the user
+ // cannot change this behavior
+ orderList.add(orderList.indexOf("stepSourceGDBInitFile") + 1, //$NON-NLS-1$
+ "stepSetTargetAsync"); //$NON-NLS-1$
+
+ return orderList.toArray(new String[orderList.size()]);
+ }
+
+ return super.getExecutionOrder(group);
+ }
+
+ @Execute
+ public void stepSetTargetAsync(RequestMonitor rm) {
+ DsfServicesTracker tracker = new DsfServicesTracker(Activator.getBundleContext(),
+ getSession().getId());
+ IMICommandControl commandControl = tracker.getService(IMICommandControl.class);
+ tracker.dispose();
+
+ if (commandControl != null) {
+ // Use target async when interfacing with GDB 7.12 or higher
+ // this will allow us to use the new enhanced GDB Full CLI console
+ commandControl.queueCommand(
+ commandControl.getCommandFactory().createMIGDBSetTargetAsync(commandControl.getContext(), true),
+ new DataRequestMonitor<MIInfo>(getExecutor(), rm) {
+ @Override
+ protected void handleError() {
+ // We should only be calling this for GDB >= 7.12,
+ // but just in case, accept errors for older GDBs
+ rm.done();
+ }
+ });
+ } else {
+ // Should never happen but accept errors in this case
+ rm.done();
+ }
+ }
+}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_12.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_12.java
new file mode 100644
index 0000000000..dce0036815
--- /dev/null
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GDBJtagControl_7_12.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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
+ *******************************************************************************/
+package org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service;
+
+import java.util.Map;
+
+import org.eclipse.cdt.debug.gdbjtag.core.GDBJtagDSFFinalLaunchSequence_7_12;
+import org.eclipse.cdt.dsf.concurrent.RequestMonitorWithProgress;
+import org.eclipse.cdt.dsf.concurrent.Sequence;
+import org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_12;
+import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
+import org.eclipse.cdt.dsf.service.DsfSession;
+import org.eclipse.debug.core.ILaunchConfiguration;
+
+/**
+ * Jtag control service which selects the Jtag CompleteInitializationSequence. Used for GDB >= 7.12
+ *
+ * @since 9.1
+ */
+public class GDBJtagControl_7_12 extends GDBControl_7_12 {
+
+ public GDBJtagControl_7_12(DsfSession session, ILaunchConfiguration config, CommandFactory factory) {
+ super(session, config, factory);
+ }
+
+ @Override
+ protected Sequence getCompleteInitializationSequence(Map<String, Object> attributes,
+ RequestMonitorWithProgress rm) {
+ return new GDBJtagDSFFinalLaunchSequence_7_12(getSession(), attributes, rm);
+ }
+} \ No newline at end of file
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GdbJtagDebugServicesFactory.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GdbJtagDebugServicesFactory.java
index cd638975c0..29af141445 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GdbJtagDebugServicesFactory.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/GdbJtagDebugServicesFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2016 Ericsson and others.
+ * Copyright (c) 2011, 2017 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
@@ -30,6 +30,9 @@ public class GdbJtagDebugServicesFactory extends GdbDebugServicesFactory {
@Override
protected ICommandControl createCommandControl(DsfSession session, ILaunchConfiguration config) {
+ if (compareVersionWith(GDB_7_12_VERSION) >= 0) {
+ return new GDBJtagControl_7_12(session, config, new CommandFactory_6_8());
+ }
if (compareVersionWith(GDB_7_7_VERSION) >= 0) {
return new GDBJtagControl_7_7(session, config, new CommandFactory_6_8());
}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/extensions/GDBJtagControl_HEAD.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/extensions/GDBJtagControl_HEAD.java
index ad7211098f..2639810fb6 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/extensions/GDBJtagControl_HEAD.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/dsf/gdb/service/extensions/GDBJtagControl_HEAD.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2015 Ericsson and others.
+ * Copyright (c) 2015, 2017 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
@@ -7,7 +7,7 @@
*******************************************************************************/
package org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.extensions;
-import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.GDBJtagControl_7_7;
+import org.eclipse.cdt.debug.gdbjtag.core.dsf.gdb.service.GDBJtagControl_7_12;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
import org.eclipse.cdt.dsf.gdb.service.GdbDebugServicesFactory;
import org.eclipse.cdt.dsf.mi.service.command.CommandFactory;
@@ -38,14 +38,14 @@ import org.eclipse.debug.core.ILaunchConfiguration;
*
* @since 8.5
*/
-public class GDBJtagControl_HEAD extends GDBJtagControl_7_7 {
+public class GDBJtagControl_HEAD extends GDBJtagControl_7_12 {
public GDBJtagControl_HEAD(DsfSession session, ILaunchConfiguration config, CommandFactory factory) {
super(session, config, factory);
validateGdbVersion(session);
}
- protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_7_VERSION; }
+ protected String getMinGDBVersionSupported() { return GdbDebugServicesFactory.GDB_7_12_VERSION; }
protected void validateGdbVersion(DsfSession session) {
GdbDebugServicesFactory.validateGdbVersion(session, getMinGDBVersionSupported(), this);
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java
index 8874d5a338..7063d23fcc 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java
@@ -79,7 +79,13 @@ public class DefaultGDBJtagDeviceImpl implements IGDBJtagDevice {
*/
@Override
public void doContinue(Collection<String> commands) {
- String cmd = "continue"; //$NON-NLS-1$
+ // The CLI version "continue" causes GDB to block and would not be
+ // able to respond other MI commands, this is a problem
+ // when running in async mode as it depends on the processing
+ // of MI commands e.g. to suspend the program.
+ // Therefore we need to use the MI command version "-exec-continue"
+ // which does not block GDB.
+ String cmd = "-exec-continue"; //$NON-NLS-1$
addCmd(commands, cmd);
}

Back to the top