Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2017-01-05 16:35:22 +0000
committerMarc Khouzam2017-01-14 13:15:47 +0000
commitbe7ee1e018c207b8d8f1a4a55ed707a2f746de26 (patch)
tree09ff6ca7a01c92cc8074fbafba791fc83c6c78e6 /dsf-gdb
parent2ee0a093d0b03abf8c116c3b18090fd787dd5cd6 (diff)
downloadorg.eclipse.cdt-be7ee1e018c207b8d8f1a4a55ed707a2f746de26.tar.gz
org.eclipse.cdt-be7ee1e018c207b8d8f1a4a55ed707a2f746de26.tar.xz
org.eclipse.cdt-be7ee1e018c207b8d8f1a4a55ed707a2f746de26.zip
Must use DSF Executor to fetch service.
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/CLIDebugActionEnabler.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/CLIDebugActionEnabler.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/CLIDebugActionEnabler.java
index 9b9d651af9e..3be9410969b 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/CLIDebugActionEnabler.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/CLIDebugActionEnabler.java
@@ -19,11 +19,14 @@ import org.eclipse.cdt.dsf.datamodel.IDMContext;
import org.eclipse.cdt.dsf.debug.service.command.ICommand;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlDMContext;
+import org.eclipse.cdt.dsf.gdb.internal.GdbPlugin;
import org.eclipse.cdt.dsf.mi.service.command.CLIEventProcessor;
import org.eclipse.cdt.dsf.mi.service.command.commands.CLICommand;
import org.eclipse.cdt.dsf.mi.service.command.commands.MIInterpreterExecConsole;
import org.eclipse.cdt.dsf.mi.service.command.output.MIInfo;
import org.eclipse.cdt.dsf.service.DsfServicesTracker;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
/**
*
@@ -35,7 +38,6 @@ public class CLIDebugActionEnabler implements ICLIDebugActionEnabler {
private final DsfExecutor fExecutor;
private final DsfServicesTracker fServiceTracker;
private final ICommandControlDMContext fContext;
- private ICommandControlService fCommandControl;
/**
* @param executor
@@ -46,7 +48,6 @@ public class CLIDebugActionEnabler implements ICLIDebugActionEnabler {
fExecutor = executor;
fServiceTracker = serviceTracker;
fContext = DMContexts.getAncestorOfType(context, ICommandControlDMContext.class);
- fCommandControl = fServiceTracker.getService(ICommandControlService.class);
assert fContext != null;
}
@@ -80,7 +81,15 @@ public class CLIDebugActionEnabler implements ICLIDebugActionEnabler {
@Override
public void run() {
// TODO: for print command would be nice to redirect to gdb console
- fCommandControl.queueCommand(cmd, new ImmediateDataRequestMonitor<>());
+ ICommandControlService commandControl = fServiceTracker.getService(ICommandControlService.class);
+ if (commandControl != null) {
+ commandControl.queueCommand(cmd, new ImmediateDataRequestMonitor<>());
+ } else {
+ // Should not happen, so log the situation but then ignore it
+ GdbPlugin.log(new Status(
+ IStatus.INFO, GdbPlugin.PLUGIN_ID,
+ "Unable to find service to execute breakpoint command")); //$NON-NLS-1$
+ }
}
});
}

Back to the top