Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jtag
diff options
context:
space:
mode:
authorMarc Khouzam2011-06-03 05:32:51 -0400
committerMarc Khouzam2011-06-03 05:32:51 -0400
commitda7276ed669403797b6e49464a85c1726bbbe3b7 (patch)
tree6d15b0036b8e96c5671651895f55313fedd07aee /jtag
parente096ea087ebd97c4e5da00177cadf44e35254e14 (diff)
downloadorg.eclipse.cdt-da7276ed669403797b6e49464a85c1726bbbe3b7.tar.gz
org.eclipse.cdt-da7276ed669403797b6e49464a85c1726bbbe3b7.tar.xz
org.eclipse.cdt-da7276ed669403797b6e49464a85c1726bbbe3b7.zip
Bug 348043: GDB (DSF) Hardware Debugging Launcher fails to complete launch
Diffstat (limited to 'jtag')
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java17
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagConnectionImpl.java7
-rw-r--r--jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagDeviceImpl.java7
3 files changed, 25 insertions, 6 deletions
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java
index 3041cc66ad..6eb35202b6 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDebugger.java
@@ -38,6 +38,8 @@ import org.eclipse.cdt.debug.mi.core.MISession;
import org.eclipse.cdt.debug.mi.core.cdi.Session;
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
import org.eclipse.cdt.debug.mi.core.command.CLICommand;
+import org.eclipse.cdt.debug.mi.core.command.MICommand;
+import org.eclipse.cdt.debug.mi.core.command.Command;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIGDBSetNewConsole;
import org.eclipse.cdt.debug.mi.core.output.MIInfo;
@@ -59,6 +61,8 @@ import org.eclipse.debug.core.ILaunchConfiguration;
*/
public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
+ private String miVersion;
+
public ICDISession createSession(ILaunch launch, File executable,
IProgressMonitor monitor) throws CoreException {
return super.createSession(launch, executable, monitor);
@@ -71,7 +75,7 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
protected CommandFactory getCommandFactory(ILaunchConfiguration config)
throws CoreException {
- String miVersion = MIPlugin.getMIVersion(config);
+ miVersion = MIPlugin.getMIVersion(config);
return new GDBJtagCommandFactory(miVersion);
}
@@ -333,13 +337,18 @@ public class GDBJtagDebugger extends AbstractGDBCDIDebugger {
for (int j = 0; j < commands.length; ++j) {
try {
submonitor.subTask(Messages.getString("GDBJtagDebugger.21") + commands[j]); //$NON-NLS-1$
- CLICommand cli = new CLICommand(commands[j]);
- miSession.postCommand(cli, MISession.FOREVER);
+ Command cmd = null;
+ if (commands[j].startsWith("-")) {
+ cmd = new MICommand(miVersion, commands[j]);
+ } else {
+ cmd = new CLICommand(commands[j]);
+ }
+ miSession.postCommand(cmd, MISession.FOREVER);
submonitor.worked(1);
if (submonitor.isCanceled()) {
throw new OperationCanceledException();
}
- MIInfo info = cli.getMIInfo();
+ MIInfo info = cmd.getMIInfo();
if (info == null) {
throw new MIException("Timeout"); //$NON-NLS-1$
}
diff --git a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagConnectionImpl.java b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagConnectionImpl.java
index 76ce10c4b1..4f2ad44a06 100644
--- a/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagConnectionImpl.java
+++ b/jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/jtagdevice/DefaultGDBJtagConnectionImpl.java
@@ -37,7 +37,12 @@ public class DefaultGDBJtagConnectionImpl extends DefaultGDBJtagDeviceImpl imple
public void doRemote(String connection, Collection<String> commands) {
String cmd = ""; //$NON-NLS-1$
if (connection != null) {
- cmd = "target remote " + connection; //$NON-NLS-1$
+ // The CLI version (target remote) does not let us know
+ // that we have properly connected. For older GDBs (<= 6.8)
+ // we need this information for a DSF session.
+ // The MI version does tell us, which is why we must use it
+ // Bug 348043
+ cmd = "-target-select remote " + connection; //$NON-NLS-1$
addCmd(commands, cmd);
}
}
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 e570df8f39..37407a6f69 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
@@ -52,7 +52,12 @@ public class DefaultGDBJtagDeviceImpl implements IGDBJtagDevice {
* @see org.eclipse.cdt.debug.gdbjtag.core.jtagdevice.IGDBJtagDevice#doRemote(java.lang.String, int, java.util.Collection)
*/
public void doRemote(String ip, int port, Collection<String> commands) {
- String cmd = "target remote " + ip + ":" + String.valueOf(port); //$NON-NLS-1$ //$NON-NLS-2$
+ // The CLI version (target remote) does not let us know
+ // that we have properly connected. For older GDBs (<= 6.8)
+ // we need this information for a DSF session.
+ // The MI version does tell us, which is why we must use it
+ // Bug 348043
+ String cmd = "-target-select remote " + ip + ":" + String.valueOf(port); //$NON-NLS-1$ //$NON-NLS-2$
addCmd(commands, cmd);
}

Back to the top