Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanimir Agovic2018-12-28 01:02:06 +0000
committerSanimir Agovic2018-12-30 21:00:23 +0000
commitb5795cf6c5bf50159038d52b91cff0b3277e0e9b (patch)
tree5bcacd1c6b125525004f5c484d339bf3ca343a46 /plugins
parente627368babd7d0771c4bad3ba9269cea5388ba44 (diff)
downloadorg.eclipse.tcf-b5795cf6c5bf50159038d52b91cff0b3277e0e9b.tar.gz
org.eclipse.tcf-b5795cf6c5bf50159038d52b91cff0b3277e0e9b.tar.xz
org.eclipse.tcf-b5795cf6c5bf50159038d52b91cff0b3277e0e9b.zip
TCF Debugger: add new option to the reset dropdown button
Add new option "Suspend after reset" to the reset menu to allow the target to suspend after reset is asserted. Change-Id: Ibcc2aa14e8c3053683f410cbb7bca454db1097c6 Signed-off-by: Sanimir Agovic <sanimir@subpath.org>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/plugin.xml19
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ResetHandler.java7
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ToggleSuspendAfterResetHandler.java33
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java6
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/preferences/TCFPreferences.java3
5 files changed, 66 insertions, 2 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/plugin.xml b/plugins/org.eclipse.tcf.debug.ui/plugin.xml
index ae5c793cc..56c0dc050 100644
--- a/plugins/org.eclipse.tcf.debug.ui/plugin.xml
+++ b/plugins/org.eclipse.tcf.debug.ui/plugin.xml
@@ -398,6 +398,16 @@
optional="true">
</commandParameter>
</command>
+ <command
+ categoryId="org.eclipse.tcf.debug.ui.commands"
+ defaultHandler="org.eclipse.tcf.internal.debug.ui.commands.ToggleSuspendAfterResetHandler"
+ id="org.eclipse.tcf.debug.ui.commands.toggleSuspendAfterReset"
+ name="Suspend after reset">
+ <state
+ class="org.eclipse.ui.handlers.RegistryToggleState"
+ id="org.eclipse.ui.commands.toggleState">
+ </state>
+ </command>
</extension>
<extension point="org.eclipse.ui.handlers">
@@ -790,6 +800,15 @@
class="org.eclipse.tcf.internal.debug.ui.commands.ResetMenu"
id="org.eclipse.tcf.debug.ui.menu.dynamic">
</dynamic>
+ <separator
+ name="group.reset"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.tcf.debug.ui.commands.toggleSuspendAfterReset"
+ label="Suspend after reset"
+ style="toggle">
+ </command>
</menuContribution>
</extension>
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ResetHandler.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ResetHandler.java
index add7eeb90..7a411f6f8 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ResetHandler.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ResetHandler.java
@@ -8,6 +8,7 @@
package org.eclipse.tcf.internal.debug.ui.commands;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.commands.AbstractHandler;
@@ -18,6 +19,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.tcf.internal.debug.ui.model.TCFNode;
import org.eclipse.tcf.internal.debug.ui.model.TCFNodeExecContext;
+import org.eclipse.tcf.internal.debug.ui.preferences.TCFPreferences;
import org.eclipse.tcf.services.IContextReset;
import org.eclipse.tcf.util.TCFDataCache;
import org.eclipse.tcf.util.TCFTask;
@@ -59,7 +61,10 @@ public class ResetHandler extends AbstractHandler {
TCFNodeExecContext exec = (TCFNodeExecContext)node;
String type = event.getParameter("org.eclipse.tcf.debug.ui.commands.reset.param.type");
if (type == null) type = getDefaultResetType(exec);
- exec.reset(type, null);
+ boolean suspend = exec.getModel().getSuspendAfterReset();
+ Map<String, Object> params = new HashMap<String, Object>();
+ if (suspend) params.put(IContextReset.PARAM_SUSPEND, true);
+ exec.reset(type, params);
break;
}
node = node.getParent();
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ToggleSuspendAfterResetHandler.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ToggleSuspendAfterResetHandler.java
new file mode 100644
index 000000000..f65fd20fc
--- /dev/null
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ToggleSuspendAfterResetHandler.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2019.
+ * 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.tcf.internal.debug.ui.commands;
+
+import java.util.Map;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.tcf.internal.debug.ui.preferences.TCFPreferences;
+import org.eclipse.ui.commands.IElementUpdater;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.menus.UIElement;
+
+public class ToggleSuspendAfterResetHandler extends AbstractHandler implements IElementUpdater {
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ boolean state = !HandlerUtil.toggleCommandState(event.getCommand());
+ TCFPreferences.getPreferenceStore().setValue(TCFPreferences.PREF_SUSPEND_AFTER_RESET, state);
+ return null;
+ }
+
+ @Override
+ public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
+ element.setChecked(TCFPreferences.getPreferenceStore().getBoolean(TCFPreferences.PREF_SUSPEND_AFTER_RESET));
+ }
+}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
index 26e938b70..08934abcf 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
@@ -246,6 +246,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
private boolean hover_while_running;
private boolean qualified_type_names_enabled;
private boolean filter_variants_by_discriminant;
+ private boolean suspend_after_reset;
private final Map<String,String> action_results = new HashMap<String,String>();
private final HashMap<String,TCFAction> active_actions = new HashMap<String,TCFAction>();
@@ -772,6 +773,7 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
hover_while_running = prefs_store.getBoolean(TCFPreferences.PREF_HOVER_WHILE_RUNNING);
qualified_type_names_enabled = prefs_store.getBoolean(TCFPreferences.PREF_SHOW_QUALIFIED_TYPE_NAMES);
filter_variants_by_discriminant = prefs_store.getBoolean(TCFPreferences.PREF_FILTER_VARIANTS_BY_DISCRIMINANT);
+ suspend_after_reset = prefs_store.getBoolean(TCFPreferences.PREF_SUSPEND_AFTER_RESET);
final boolean affectsExpressionsOnly = event != null && (
TCFPreferences.PREF_SHOW_QUALIFIED_TYPE_NAMES.equals(event.getProperty()) ||
TCFPreferences.PREF_FILTER_VARIANTS_BY_DISCRIMINANT.equals(event.getProperty()));
@@ -1130,6 +1132,10 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
return hover_while_running;
}
+ public boolean getSuspendAfterReset() {
+ return suspend_after_reset;
+ }
+
void onProxyInstalled(TCFModelProxy mp) {
IPresentationContext pc = mp.getPresentationContext();
model_proxies.add(mp);
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/preferences/TCFPreferences.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/preferences/TCFPreferences.java
index f21f97341..e14fd4789 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/preferences/TCFPreferences.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/preferences/TCFPreferences.java
@@ -32,7 +32,8 @@ public class TCFPreferences {
PREF_FULL_ERROR_REPORTS = "FullErrorReports",
PREF_HOVER_WHILE_RUNNING = "HoverWhileRunning",
PREF_SHOW_QUALIFIED_TYPE_NAMES = "ShowQualifiedTypeNames",
- PREF_FILTER_VARIANTS_BY_DISCRIMINANT = "FilterVariantsByDiscriminant";
+ PREF_FILTER_VARIANTS_BY_DISCRIMINANT = "FilterVariantsByDiscriminant",
+ PREF_SUSPEND_AFTER_RESET = "SuspendAfterReset";
public static IPreferenceStore getPreferenceStore() {
return Activator.getDefault().getPreferenceStore();

Back to the top