diff options
author | Alvaro Sanchez-Leon | 2017-01-27 20:52:20 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2017-02-06 20:09:32 +0000 |
commit | f6f53aa705278263250d165c032c74b93a89ca35 (patch) | |
tree | c0f02e424c80ab8cee4f30c6cf32ebed163c0252 /jtag/org.eclipse.cdt.debug.gdbjtag.core | |
parent | 7d0117d24e332e2dfa8cd21934496a5d474590da (diff) | |
download | org.eclipse.cdt-f6f53aa705278263250d165c032c74b93a89ca35.tar.gz org.eclipse.cdt-f6f53aa705278263250d165c032c74b93a89ca35.tar.xz org.eclipse.cdt-f6f53aa705278263250d165c032c74b93a89ca35.zip |
Bug 511243 - MI async mode shall not be activated for all cases when
using GDB 7.12
This solution makes the following changes:
* With GDB 7.12, use async mode as long as the Full GDB console is
supported or if the launch is configured for Non stop mode
* with GDB 7.12, don't always use MI to interrupt the service, use the
CLI when the async mode is off
Change-Id: I92c466e028b400f9054298739cd80efac18bd03a
Diffstat (limited to 'jtag/org.eclipse.cdt.debug.gdbjtag.core')
-rw-r--r-- | jtag/org.eclipse.cdt.debug.gdbjtag.core/src/org/eclipse/cdt/debug/gdbjtag/core/GDBJtagDSFFinalLaunchSequence_7_12.java | 45 |
1 files changed, 24 insertions, 21 deletions
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 index f6b05b76138..d97d74d96c5 100644 --- 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 @@ -15,6 +15,7 @@ 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.gdb.service.IGDBBackend; 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; @@ -51,27 +52,29 @@ public class GDBJtagDSFFinalLaunchSequence_7_12 extends GDBJtagDSFFinalLaunchSeq @Execute public void stepSetTargetAsync(RequestMonitor rm) { - DsfServicesTracker tracker = new DsfServicesTracker(Activator.getBundleContext(), - getSession().getId()); - IMICommandControl commandControl = tracker.getService(IMICommandControl.class); - tracker.dispose(); + // Processing this request after sourcing the gdbinit file to make sure the user + // cannot change this behavior + DsfServicesTracker tracker = new DsfServicesTracker(Activator.getBundleContext(), + getSession().getId()); + IMICommandControl commandControl = tracker.getService(IMICommandControl.class); + IGDBBackend gdbBackEnd = tracker.getService(IGDBBackend.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(); - } + if (commandControl != null && gdbBackEnd != null) { + // Use target async when interfacing with the full GDB console (i.e. minimum GDB version 7.12) + // otherwise explicitly set it to off. + commandControl.queueCommand( + commandControl.getCommandFactory().createMIGDBSetTargetAsync(commandControl.getContext(), gdbBackEnd.isFullGdbConsoleSupported()), + new DataRequestMonitor<MIInfo>(getExecutor(), rm) { + @Override + protected void handleError() { + // Accept errors for older GDBs + rm.done(); + } + }); + } else { + // Should not happen + rm.done(); + } } } |