Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2011-10-25 18:14:05 +0000
committerEugene Tarassov2011-10-25 18:14:05 +0000
commitd6c4bcd4ffc0668bcb97fb2afb4378498c4b718c (patch)
tree4bc53d109896dc959e1153fd2826127825377fba /plugins
parentdde750d8c6d94fc9545f677fde48229388634900 (diff)
downloadorg.eclipse.tcf-d6c4bcd4ffc0668bcb97fb2afb4378498c4b718c.tar.gz
org.eclipse.tcf-d6c4bcd4ffc0668bcb97fb2afb4378498c4b718c.tar.xz
org.eclipse.tcf-d6c4bcd4ffc0668bcb97fb2afb4378498c4b718c.zip
TCF Debugger: implemented "Breakpoint Hit" update policy.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties1
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/UpdatePolicyMenu.java16
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java32
3 files changed, 40 insertions, 9 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties b/plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties
index 99651388b..693faaef4 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/plugin.properties
@@ -27,6 +27,7 @@ MemoryMap.label = Symbol Files...
ViewMemory.label = View Memory
WatchInExpressions.label = Watch In Expressions
Refresh.label = Refresh
+UpdatePolicy.label = Update Policy
CastToType.label=Cast To Type...
CastToType.tooltip=Cast Expression To Type
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/UpdatePolicyMenu.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/UpdatePolicyMenu.java
index a574ce990..dc79798e1 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/UpdatePolicyMenu.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/commands/UpdatePolicyMenu.java
@@ -13,6 +13,7 @@ import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.tm.internal.tcf.debug.ui.model.TCFModel;
import org.eclipse.tm.internal.tcf.debug.ui.model.TCFNode;
import org.eclipse.tm.tcf.util.TCFTask;
import org.eclipse.ui.IWorkbenchPart;
@@ -25,7 +26,7 @@ public class UpdatePolicyMenu extends CompoundContributionItem {
private static final String[] policy_names = {
"Automatic",
"Manual",
- //"Breakpoint Hit",
+ "Breakpoint Hit",
};
@Override
@@ -87,8 +88,9 @@ public class UpdatePolicyMenu extends CompoundContributionItem {
if (node == null) return 0;
return new TCFTask<Integer>(node.getChannel()) {
public void run() {
- if (!node.getModel().isLocked(part)) done(0);
- else done(1);
+ TCFModel model = node.getModel();
+ if (!model.isLocked(part)) done(TCFModel.UPDATE_POLICY_AUTOMATIC);
+ else done(model.getLockPolicy(part));
}
}.getE();
}
@@ -100,12 +102,8 @@ public class UpdatePolicyMenu extends CompoundContributionItem {
if (node == null) return;
new TCFTask<Object>(node.getChannel()) {
public void run() {
- if (n == 0) {
- node.getModel().clearLock(part);
- }
- else {
- node.getModel().setLock(part);
- }
+ TCFModel model = node.getModel();
+ model.setLockPolicy(part, n);
done(null);
}
}.getE();
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java
index bc9ff9186..c4eb40d9c 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java
@@ -145,6 +145,11 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
/** The id of a pinned view description presentation context */
public static final String ID_PINNED_VIEW = Activator.PLUGIN_ID + ".pinned_view";
+ public static final int
+ UPDATE_POLICY_AUTOMATIC = 0,
+ UPDATE_POLICY_MANUAL = 1,
+ UPDATE_POLICY_BREAKPOINT = 2;
+
/**
* A dummy editor input to open the disassembly view as editor.
*/
@@ -278,6 +283,7 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
private final Map<IWorkbenchPart,TCFNode> pins = new HashMap<IWorkbenchPart,TCFNode>();
private final Map<IWorkbenchPart,TCFSnapshot> locks = new HashMap<IWorkbenchPart,TCFSnapshot>();
+ private final Map<IWorkbenchPart,Integer> lock_policy = new HashMap<IWorkbenchPart,Integer>();
private TCFConsole console;
@@ -1380,6 +1386,24 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
return true;
}
+ public void setLockPolicy(IWorkbenchPart part, int policy) {
+ if (policy == UPDATE_POLICY_AUTOMATIC) {
+ clearLock(part);
+ lock_policy.remove(part);
+ }
+ else {
+ if (!isLocked(part)) setLock(part);
+ lock_policy.put(part, policy);
+ }
+ }
+
+ public int getLockPolicy(IWorkbenchPart part) {
+ if (locks.get(part) == null) return UPDATE_POLICY_AUTOMATIC;
+ Integer i = lock_policy.get(part);
+ if (i == null || i.intValue() == 0) return UPDATE_POLICY_MANUAL;
+ return i.intValue();
+ }
+
TCFSnapshot getSnapshot(IPresentationContext ctx) {
return locks.get(ctx.getPart());
}
@@ -1399,6 +1423,14 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
if (delay_stack_update_until_last_step && launch.getContextActionsCount(node.id) != 0) continue;
if (expanded_nodes.add(node.id)) proxy.expand(node);
}
+ if (reason.equals(IRunControl.REASON_BREAKPOINT)) {
+ IWorkbenchPart part = proxy.getPresentationContext().getPart();
+ int policy = getLockPolicy(part);
+ if (policy == UPDATE_POLICY_BREAKPOINT) {
+ clearLock(part);
+ setLock(part);
+ }
+ }
}
}

Back to the top