Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2017-05-05 09:05:51 -0400
committerGerrit Code Review @ Eclipse.org2017-05-05 09:42:33 -0400
commit903da9280386c8812b9a3f7a4c53de75caf0fb7e (patch)
tree54721a57736f6bc5930270f21f976c2616ab4c3c /dsf-gdb
parent5defeb26ac9e252195bd49c4ac4df3aaf83b66e6 (diff)
downloadorg.eclipse.cdt-903da9280386c8812b9a3f7a4c53de75caf0fb7e.tar.gz
org.eclipse.cdt-903da9280386c8812b9a3f7a4c53de75caf0fb7e.tar.xz
org.eclipse.cdt-903da9280386c8812b9a3f7a4c53de75caf0fb7e.zip
Bug 516244: Allow subclasses to provide the current CLI context
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java21
1 files changed, 18 insertions, 3 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java
index 33a0652fb2..d3d6a9280d 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/AbstractCLIProcess.java
@@ -421,6 +421,20 @@ public abstract class AbstractCLIProcess extends Process
return false;
}
+ /**
+ * Return the context under which CLI commands are sent to the backend.
+ * <p>
+ * Returning a context narrower than ICommandControlDMContext will cause
+ * the communication with the backend to select the appropriate thread or
+ * frame.
+ *
+ * @return the CLI context
+ * @since 5.3
+ */
+ protected IDMContext getCliCommandContext() {
+ return getCommandControlService().getContext();
+ }
+
private class CLIOutputStream extends OutputStream {
private final StringBuilder buf = new StringBuilder();
@@ -460,16 +474,17 @@ public abstract class AbstractCLIProcess extends Process
// 3-
// Normal Command Line Interface.
boolean secondary = inSecondaryPrompt();
+ IDMContext context = getCliCommandContext();
if (secondary) {
- cmd = new RawCommand(getCommandControlService().getContext(), str);
+ cmd = new RawCommand(context, str);
}
else if (! isMIOperation(str) &&
! CLIEventProcessor.isSteppingOperation(str))
{
- cmd = new ProcessMIInterpreterExecConsole(getCommandControlService().getContext(), str);
+ cmd = new ProcessMIInterpreterExecConsole(context, str);
}
else {
- cmd = new ProcessCLICommand(getCommandControlService().getContext(), str);
+ cmd = new ProcessCLICommand(context, str);
}
final ICommand<MIInfo> finalCmd = cmd;
fSession.getExecutor().execute(new DsfRunnable() { @Override public void run() {

Back to the top