Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-06-21 11:28:14 -0400
committereutarass2011-06-21 11:28:14 -0400
commit228d732ce01e8ec04f0e3f98f7c9c304c82e51e6 (patch)
tree016d4873217ea54b3e75221ec0dc4f5d04bd4445 /plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse
parent2bd0d9a55879b68d59e4aecdb4b11d629562dbfd (diff)
downloadorg.eclipse.tcf-228d732ce01e8ec04f0e3f98f7c9c304c82e51e6.tar.gz
org.eclipse.tcf-228d732ce01e8ec04f0e3f98f7c9c304c82e51e6.tar.xz
org.eclipse.tcf-228d732ce01e8ec04f0e3f98f7c9c304c82e51e6.zip
TCF Debugger: implemented preferences page.
Diffstat (limited to 'plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse')
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModel.java188
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java48
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java5
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java22
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java8
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeLaunch.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java10
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeSymbol.java4
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/DecoratingIntegerFieldEditor.java106
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/IntegerWithBooleanFieldEditor.java146
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFDebugPreferencePage.java125
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferences.java32
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferencesInitializer.java32
14 files changed, 636 insertions, 94 deletions
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 a7b707f39..52946b973 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
@@ -62,10 +62,13 @@ import org.eclipse.debug.ui.contexts.ISuspendTrigger;
import org.eclipse.debug.ui.contexts.ISuspendTriggerListener;
import org.eclipse.debug.ui.sourcelookup.CommonSourceNotFoundEditorInput;
import org.eclipse.debug.ui.sourcelookup.ISourceDisplay;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredViewer;
@@ -95,6 +98,7 @@ import org.eclipse.tm.internal.tcf.debug.ui.commands.StepOverCommand;
import org.eclipse.tm.internal.tcf.debug.ui.commands.StepReturnCommand;
import org.eclipse.tm.internal.tcf.debug.ui.commands.SuspendCommand;
import org.eclipse.tm.internal.tcf.debug.ui.commands.TerminateCommand;
+import org.eclipse.tm.internal.tcf.debug.ui.preferences.TCFPreferences;
import org.eclipse.tm.tcf.core.Command;
import org.eclipse.tm.tcf.protocol.IChannel;
import org.eclipse.tm.tcf.protocol.IErrorReport;
@@ -174,10 +178,17 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
private final List<ISuspendTriggerListener> suspend_trigger_listeners =
new LinkedList<ISuspendTriggerListener>();
- private static int display_source_generation;
+ private int display_source_generation;
private int suspend_trigger_generation;
private int auto_disconnect_generation;
+ private long min_view_updates_interval;
+ private boolean view_updates_throttle_enabled;
+ private boolean channel_throttle_enabled;
+ private boolean wait_for_pc_update_after_step;
+ private boolean wait_for_views_update_after_step;
+ private boolean delay_stack_update_until_last_step;
+
private final Map<String,String> action_results = new HashMap<String,String>();
private final HashMap<String,TCFAction> active_actions = new HashMap<String,TCFAction>();
@@ -523,7 +534,7 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
private volatile boolean instruction_stepping_enabled;
- TCFModel(TCFLaunch launch) {
+ TCFModel(final TCFLaunch launch) {
this.launch = launch;
display = PlatformUI.getWorkbench().getDisplay();
selection_policy = new TCFModelSelectionPolicy(this);
@@ -547,6 +558,20 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
expr_manager.addExpressionListener(expressions_listener);
annotation_manager = Activator.getAnnotationManager();
launch.addActionsListener(actions_listener);
+ final IPreferenceStore prefs = TCFPreferences.getPreferenceStore();
+ IPropertyChangeListener listener = new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ launch.setContextActionsInterval(prefs.getLong(TCFPreferences.PREF_MIN_STEP_INTERVAL));
+ min_view_updates_interval = prefs.getLong(TCFPreferences.PREF_MIN_UPDATE_INTERVAL);
+ view_updates_throttle_enabled = prefs.getBoolean(TCFPreferences.PREF_VIEW_UPDATES_THROTTLE);
+ channel_throttle_enabled = prefs.getBoolean(TCFPreferences.PREF_TARGET_TRAFFIC_THROTTLE);
+ wait_for_pc_update_after_step = prefs.getBoolean(TCFPreferences.PREF_WAIT_FOR_PC_UPDATE_AFTER_STEP);
+ wait_for_views_update_after_step = prefs.getBoolean(TCFPreferences.PREF_WAIT_FOR_VIEWS_UPDATE_AFTER_STEP);
+ delay_stack_update_until_last_step = prefs.getBoolean(TCFPreferences.PREF_DELAY_STACK_UPDATE_UNTIL_LAST_STEP);
+ }
+ };
+ listener.propertyChange(null);
+ prefs.addPropertyChangeListener(listener);
}
/**
@@ -659,6 +684,26 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
return action_results.get(id);
}
+ public long getMinViewUpdatesInterval() {
+ return min_view_updates_interval;
+ }
+
+ public boolean getViewUpdatesThrottleEnabled() {
+ return view_updates_throttle_enabled;
+ }
+
+ public boolean getWaitForViewsUpdateAfterStep() {
+ return wait_for_views_update_after_step;
+ }
+
+ public boolean getDelayStackUpdateUtilLastStep() {
+ return delay_stack_update_until_last_step;
+ }
+
+ public boolean getChannelThrottleEnabled() {
+ return channel_throttle_enabled;
+ }
+
void onProxyInstalled(TCFModelProxy mp) {
IPresentationContext pc = mp.getPresentationContext();
model_proxies.put(mp.getPresentationContext(), mp);
@@ -1018,6 +1063,7 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
proxy.setSelection(node);
if (reason.equals(IRunControl.REASON_STEP)) continue;
if (reason.equals(IRunControl.REASON_CONTAINER)) continue;
+ if (delay_stack_update_until_last_step && launch.getContextActionsCount(node.id) != 0) continue;
proxy.expand(node);
}
}
@@ -1029,6 +1075,7 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
* The method is normally called from SourceLookupService.
*/
public void displaySource(Object model_element, final IWorkbenchPage page, boolean forceSourceLookup) {
+ if (wait_for_pc_update_after_step) launch.addPendingClient(TCFModel.this);
final int cnt = ++display_source_generation;
/* Because of racing in Eclipse Debug infrastructure, 'model_element' value can be invalid.
* As a workaround, get current debug view selection.
@@ -1098,80 +1145,85 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
final boolean disassembly_available = channel.getRemoteService(IDisassembly.class) != null;
display.asyncExec(new Runnable() {
public void run() {
- if (cnt != display_source_generation) return;
- String editor_id = null;
- IEditorInput editor_input = null;
- int line = 0;
- if (area != null) {
- ISourceLocator locator = getLaunch().getSourceLocator();
- Object source_element = null;
- if (locator instanceof TCFSourceLookupDirector) {
- source_element = ((TCFSourceLookupDirector)locator).getSourceElement(area);
- }
- else if (locator instanceof ISourceLookupDirector) {
- // support for foreign (CDT) source locator
- String filename = TCFSourceLookupParticipant.toFileName(area);
- if (filename != null) {
- source_element = ((ISourceLookupDirector)locator).getSourceElement(filename);
- if (source_element == null && !filename.equals(area.file)) {
- // retry with relative path
- source_element = ((ISourceLookupDirector)locator).getSourceElement(area.file);
+ try {
+ if (cnt != display_source_generation) return;
+ String editor_id = null;
+ IEditorInput editor_input = null;
+ int line = 0;
+ if (area != null) {
+ ISourceLocator locator = getLaunch().getSourceLocator();
+ Object source_element = null;
+ if (locator instanceof TCFSourceLookupDirector) {
+ source_element = ((TCFSourceLookupDirector)locator).getSourceElement(area);
+ }
+ else if (locator instanceof ISourceLookupDirector) {
+ // support for foreign (CDT) source locator
+ String filename = TCFSourceLookupParticipant.toFileName(area);
+ if (filename != null) {
+ source_element = ((ISourceLookupDirector)locator).getSourceElement(filename);
+ if (source_element == null && !filename.equals(area.file)) {
+ // retry with relative path
+ source_element = ((ISourceLookupDirector)locator).getSourceElement(area.file);
+ }
}
}
+ if (source_element != null) {
+ ISourcePresentation presentation = TCFModelPresentation.getDefault();
+ if (presentation != null) {
+ editor_input = presentation.getEditorInput(source_element);
+ }
+ if (editor_input != null) {
+ editor_id = presentation.getEditorId(editor_input, source_element);
+ }
+ line = area.start_line;
+ }
}
- if (source_element != null) {
- ISourcePresentation presentation = TCFModelPresentation.getDefault();
+ if (area != null && !instruction_stepping_enabled && (editor_input == null || editor_id == null)) {
+ ILaunchConfiguration cfg = launch.getLaunchConfiguration();
+ ISourceNotFoundPresentation presentation = (ISourceNotFoundPresentation) DebugPlugin.getAdapter(element, ISourceNotFoundPresentation.class);
if (presentation != null) {
- editor_input = presentation.getEditorInput(source_element);
+ String filename = TCFSourceLookupParticipant.toFileName(area);
+ editor_input = presentation.getEditorInput(element, cfg, filename);
+ editor_id = presentation.getEditorId(editor_input, element);
}
- if (editor_input != null) {
- editor_id = presentation.getEditorId(editor_input, source_element);
+ if (editor_id == null || editor_input == null) {
+ editor_id = IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR;
+ editor_input = editor_not_found.get(cfg);
+ if (editor_input == null) {
+ editor_input = new CommonSourceNotFoundEditorInput(cfg);
+ editor_not_found.put(cfg, editor_input);
+ }
}
- line = area.start_line;
}
- }
- if (area != null && !instruction_stepping_enabled && (editor_input == null || editor_id == null)) {
- ILaunchConfiguration cfg = launch.getLaunchConfiguration();
- ISourceNotFoundPresentation presentation = (ISourceNotFoundPresentation) DebugPlugin.getAdapter(element, ISourceNotFoundPresentation.class);
- if (presentation != null) {
- String filename = TCFSourceLookupParticipant.toFileName(area);
- editor_input = presentation.getEditorInput(element, cfg, filename);
- editor_id = presentation.getEditorId(editor_input, element);
+ if (exe_id != null && disassembly_available &&
+ (editor_input == null || editor_id == null || instruction_stepping_enabled) &&
+ PlatformUI.getWorkbench().getEditorRegistry().findEditor(
+ DisassemblyEditorInput.EDITOR_ID) != null) {
+ editor_id = DisassemblyEditorInput.EDITOR_ID;
+ editor_input = DisassemblyEditorInput.INSTANCE;
}
- if (editor_id == null || editor_input == null) {
- editor_id = IDebugUIConstants.ID_COMMON_SOURCE_NOT_FOUND_EDITOR;
- editor_input = editor_not_found.get(cfg);
- if (editor_input == null) {
- editor_input = new CommonSourceNotFoundEditorInput(cfg);
- editor_not_found.put(cfg, editor_input);
+ if (cnt != display_source_generation) return;
+ ITextEditor text_editor = null;
+ if (page != null && editor_input != null && editor_id != null) {
+ IEditorPart editor = openEditor(editor_input, editor_id, page);
+ if (editor instanceof ITextEditor) {
+ text_editor = (ITextEditor)editor;
+ }
+ else {
+ text_editor = (ITextEditor)editor.getAdapter(ITextEditor.class);
}
}
- }
- if (exe_id != null && disassembly_available &&
- (editor_input == null || editor_id == null || instruction_stepping_enabled) &&
- PlatformUI.getWorkbench().getEditorRegistry().findEditor(
- DisassemblyEditorInput.EDITOR_ID) != null) {
- editor_id = DisassemblyEditorInput.EDITOR_ID;
- editor_input = DisassemblyEditorInput.INSTANCE;
- }
- if (cnt != display_source_generation) return;
- ITextEditor text_editor = null;
- if (page != null && editor_input != null && editor_id != null) {
- IEditorPart editor = openEditor(editor_input, editor_id, page);
- if (editor instanceof ITextEditor) {
- text_editor = (ITextEditor)editor;
- }
- else {
- text_editor = (ITextEditor)editor.getAdapter(ITextEditor.class);
+ IRegion region = null;
+ if (text_editor != null) {
+ region = getLineInformation(text_editor, line);
+ if (region != null) text_editor.selectAndReveal(region.getOffset(), 0);
}
+ annotation_manager.addStackFrameAnnotation(TCFModel.this,
+ exe_id, top_frame, page, text_editor, region);
}
- IRegion region = null;
- if (text_editor != null) {
- region = getLineInformation(text_editor, line);
- if (region != null) text_editor.selectAndReveal(region.getOffset(), 0);
+ finally {
+ if (cnt == display_source_generation) launch.removePendingClient(TCFModel.this);
}
- annotation_manager.addStackFrameAnnotation(TCFModel.this,
- exe_id, top_frame, page, text_editor, region);
}
});
}
@@ -1334,10 +1386,14 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
}
private synchronized void runSuspendTrigger(final TCFNode node) {
- final int generation = ++suspend_trigger_generation;
final ISuspendTriggerListener[] listeners = suspend_trigger_listeners.toArray(
new ISuspendTriggerListener[suspend_trigger_listeners.size()]);
if (listeners.length == 0) return;
+
+ final int generation = ++suspend_trigger_generation;
+ if (wait_for_pc_update_after_step || wait_for_views_update_after_step) {
+ launch.addPendingClient(suspend_trigger_listeners);
+ }
display.asyncExec(new Runnable() {
public void run() {
synchronized (TCFModel.this) {
@@ -1351,6 +1407,10 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
Activator.log(x);
}
}
+ synchronized (TCFModel.this) {
+ if (generation != suspend_trigger_generation) return;
+ launch.removePendingClient(suspend_trigger_listeners);
+ }
}
});
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
index 41b504f0e..ac2ebda8c 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFModelProxy.java
@@ -22,7 +22,9 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdateListener;
import org.eclipse.debug.internal.ui.viewers.model.provisional.ModelDelta;
+import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.Viewer;
@@ -38,11 +40,10 @@ import org.eclipse.tm.tcf.protocol.Protocol;
*/
public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Runnable {
- private static final long MIN_IDLE_TIME = 50;
-
private static final TCFNode[] EMPTY_NODE_ARRAY = new TCFNode[0];
private final TCFModel model;
+ private final TCFLaunch launch;
private final Map<TCFNode,Integer> node2flags = new HashMap<TCFNode,Integer>();
private final Map<TCFNode,TCFNode[]> node2children = new HashMap<TCFNode,TCFNode[]>();
private final Map<TCFNode,ModelDelta> node2delta = new HashMap<TCFNode,ModelDelta>();
@@ -59,10 +60,16 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
public void run() {
posted = false;
long idle_time = System.currentTimeMillis() - last_update_time;
- long min_idle_time = MIN_IDLE_TIME;
- int congestion = Protocol.getCongestionLevel() + 50;
- if (congestion > 0) min_idle_time += congestion * 10;
- if (idle_time < min_idle_time - 10) {
+ long min_idle_time = model.getMinViewUpdatesInterval();
+ if (model.getViewUpdatesThrottleEnabled()) {
+ int congestion = Protocol.getCongestionLevel() + 50;
+ if (congestion > 0) min_idle_time += congestion * 10;
+ }
+ if (model.getChannelThrottleEnabled()) {
+ int congestion = model.getChannel().getCongestion() + 50;
+ if (congestion > 0) min_idle_time += congestion * 10;
+ }
+ if (idle_time < min_idle_time - 5) {
Protocol.invokeLater(min_idle_time - idle_time, this);
posted = true;
}
@@ -143,6 +150,24 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
}
}
+ private final IViewerUpdateListener update_listener = new IViewerUpdateListener() {
+
+ public void viewerUpdatesBegin() {
+ if (!model.getWaitForViewsUpdateAfterStep()) return;
+ launch.addPendingClient(this);
+ }
+
+ public void viewerUpdatesComplete() {
+ launch.removePendingClient(this);
+ }
+
+ public void updateStarted(IViewerUpdate update) {
+ }
+
+ public void updateComplete(IViewerUpdate update) {
+ }
+ };
+
private final ChildrenCountUpdate children_count_update = new ChildrenCountUpdate();
private final ChildrenUpdate children_update = new ChildrenUpdate();
@@ -150,10 +175,12 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
TCFModelProxy(TCFModel model) {
this.model = model;
+ launch = model.getLaunch();
}
public void installed(Viewer viewer) {
super.installed(viewer);
+ ((TreeModelViewer)viewer).addViewerUpdateListener(update_listener);
Protocol.invokeAndWait(new Runnable() {
public void run() {
assert !installed;
@@ -172,6 +199,8 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
disposed = true;
}
});
+ ((TreeModelViewer)getViewer()).removeViewerUpdateListener(update_listener);
+ launch.removePendingClient(update_listener);
super.dispose();
}
@@ -231,7 +260,8 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
assert installed && !disposed;
if (!posted) {
long idle_time = System.currentTimeMillis() - last_update_time;
- Protocol.invokeLater(MIN_IDLE_TIME - idle_time, timer);
+ Protocol.invokeLater(model.getMinViewUpdatesInterval() - idle_time, timer);
+ if (model.getWaitForViewsUpdateAfterStep()) launch.addPendingClient(this);
posted = true;
}
}
@@ -293,7 +323,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
if (selection != null && selection != node || (flags & IModelDelta.EXPAND) != 0) {
children = getNodeChildren(node).length;
}
- delta = root.addNode(model.getLaunch(), -1, flags, children);
+ delta = root.addNode(launch, -1, flags, children);
}
else {
TCFNode parent = node.getParent(getPresentationContext());
@@ -321,6 +351,7 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
private void postDelta(final ModelDelta root) {
assert pending_node == null;
+ launch.removePendingClient(this);
model.getDisplay().asyncExec(new Runnable() {
public void run() {
fireModelChanged(root);
@@ -339,7 +370,6 @@ public class TCFModelProxy extends AbstractModelProxy implements IModelProxy, Ru
model.getDisplay().asyncExec(new Runnable() {
boolean found;
public void run() {
- TCFLaunch launch = model.getLaunch();
Tree tree = (Tree)getViewer().getControl();
for (TreeItem item : tree.getItems()) {
if (item.getData() == launch) {
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java
index 039de334d..df1e661b1 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNode.java
@@ -23,6 +23,7 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.ILabelUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate;
+import org.eclipse.tm.internal.tcf.debug.model.TCFLaunch;
import org.eclipse.tm.tcf.protocol.IChannel;
import org.eclipse.tm.tcf.protocol.Protocol;
import org.eclipse.tm.tcf.util.TCFDataCache;
@@ -37,6 +38,7 @@ public abstract class TCFNode extends PlatformObject implements Comparable<TCFNo
protected final String id;
protected final TCFNode parent;
protected final TCFModel model;
+ protected final TCFLaunch launch;
protected final IChannel channel;
private boolean disposed;
@@ -67,6 +69,7 @@ public abstract class TCFNode extends PlatformObject implements Comparable<TCFNo
protected TCFNode(TCFModel model) {
id = null;
parent = null;
+ launch = model.getLaunch();
channel = model.getChannel();
this.model = model;
}
@@ -85,6 +88,7 @@ public abstract class TCFNode extends PlatformObject implements Comparable<TCFNo
this.id = id;
model = parent.model;
model.addNode(id, this);
+ launch = model.getLaunch();
channel = model.getChannel();
}
@@ -255,7 +259,6 @@ public abstract class TCFNode extends PlatformObject implements Comparable<TCFNo
public void run() {
if (!done) {
if (!update.isCanceled()) {
- IChannel channel = model.getLaunch().getChannel();
if (!disposed && channel.getState() == IChannel.STATE_OPEN) {
if (!getData(update, this)) return;
}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
index e473a38e7..2a251dbb3 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java
@@ -220,7 +220,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
@Override
protected boolean startDataRetrieval() {
assert command == null;
- IMemory mem = model.getLaunch().getService(IMemory.class);
+ IMemory mem = launch.getService(IMemory.class);
if (mem == null) {
set(null, null, null);
return true;
@@ -237,7 +237,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
@Override
protected boolean startDataRetrieval() {
assert command == null;
- IRunControl run = model.getLaunch().getService(IRunControl.class);
+ IRunControl run = launch.getService(IRunControl.class);
if (run == null) {
set(null, null, null);
return true;
@@ -254,7 +254,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
@Override
protected boolean startDataRetrieval() {
assert command == null;
- IProcesses prs = model.getLaunch().getService(IProcesses.class);
+ IProcesses prs = launch.getService(IProcesses.class);
if (prs == null) {
set(null, null, null);
return true;
@@ -271,7 +271,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
@Override
protected boolean startDataRetrieval() {
assert command == null;
- IMemoryMap mmap = model.getLaunch().getService(IMemoryMap.class);
+ IMemoryMap mmap = launch.getService(IMemoryMap.class);
if (mmap == null) {
set(null, null, null);
return true;
@@ -528,7 +528,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
ref_cache = line_info_lookup_cache.get(addr);
if (ref_cache != null) return ref_cache;
}
- final ILineNumbers ln = model.getLaunch().getService(ILineNumbers.class);
+ final ILineNumbers ln = launch.getService(ILineNumbers.class);
if (ln == null) return null;
final BigInteger n0 = addr;
final BigInteger n1 = n0.add(BigInteger.valueOf(1));
@@ -591,7 +591,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
ref_cache = func_info_lookup_cache.get(addr);
if (ref_cache != null) return ref_cache;
}
- final ISymbols syms = model.getLaunch().getService(ISymbols.class);
+ final ISymbols syms = launch.getService(ISymbols.class);
if (syms == null) return null;
if (func_info_lookup_cache == null) {
func_info_lookup_cache = new LinkedHashMap<BigInteger,TCFDataCache<TCFFunctionRef>>(11, 0.75f, true);
@@ -654,7 +654,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
public TCFNode getParent(IPresentationContext ctx) {
assert Protocol.isDispatchThread();
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(ctx.getId())) {
- Set<String> ids = model.getLaunch().getContextFilter();
+ Set<String> ids = launch.getContextFilter();
if (ids != null) {
if (ids.contains(id)) return model.getRootNode();
if (parent instanceof TCFNodeLaunch) return null;
@@ -1080,7 +1080,11 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
for (TCFModelProxy p : model.getModelProxies()) {
int flags = 0;
String view_id = p.getPresentationContext().getId();
- if (IDebugUIConstants.ID_DEBUG_VIEW.equals(view_id)) flags |= IModelDelta.CONTENT;
+ if (IDebugUIConstants.ID_DEBUG_VIEW.equals(view_id) &&
+ (launch.getContextActionsCount(id) == 0 ||
+ !model.getDelayStackUpdateUtilLastStep())) {
+ flags |= IModelDelta.CONTENT;
+ }
if (IDebugUIConstants.ID_REGISTER_VIEW.equals(view_id) ||
IDebugUIConstants.ID_EXPRESSION_VIEW.equals(view_id) ||
TCFModel.ID_EXPRESSION_HOVER.equals(view_id)) {
@@ -1161,7 +1165,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
resumed_by_action = false;
dispose();
postContextRemovedDelta();
- model.getLaunch().removeContextActions(id);
+ launch.removeContextActions(id);
}
void onExpressionAddedOrRemoved() {
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java
index 666ae2aa1..bbbf451f7 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java
@@ -106,7 +106,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
var_expression = new TCFData<IExpressions.Expression>(channel) {
@Override
protected boolean startDataRetrieval() {
- IExpressions exps = model.getLaunch().getService(IExpressions.class);
+ IExpressions exps = launch.getService(IExpressions.class);
if (exps == null || var_id == null) {
set(null, null, null);
return true;
@@ -168,7 +168,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
expression = new TCFData<Expression>(channel) {
@Override
protected boolean startDataRetrieval() {
- IExpressions exps = model.getLaunch().getService(IExpressions.class);
+ IExpressions exps = launch.getService(IExpressions.class);
if (exps == null) {
set(null, null, null);
return true;
@@ -229,7 +229,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
set(null, expression.getError(), null);
return true;
}
- IExpressions exps = model.getLaunch().getService(IExpressions.class);
+ IExpressions exps = launch.getService(IExpressions.class);
command = exps.evaluate(exp.expression.getID(), new IExpressions.DoneEvaluate() {
public void doneEvaluate(IToken token, Exception error, IExpressions.Value value) {
if (error != null) {
@@ -1348,7 +1348,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
}
if (error != null) throw new Exception("Invalid value: " + value, new Exception(error));
if (bf != null) {
- IExpressions exps = node.model.getLaunch().getService(IExpressions.class);
+ IExpressions exps = node.launch.getService(IExpressions.class);
exps.assign(exp.getID(), bf, new IExpressions.DoneAssign() {
public void doneAssign(IToken token, Exception error) {
node.getRootExpression().onValueChanged();
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeLaunch.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeLaunch.java
index 2db83c6f4..a497a26fb 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeLaunch.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeLaunch.java
@@ -35,7 +35,7 @@ public class TCFNodeLaunch extends TCFNode implements ISymbolOwner {
filtered_children = new TCFChildren(this) {
@Override
protected boolean startDataRetrieval() {
- Set<String> filter = model.getLaunch().getContextFilter();
+ Set<String> filter = launch.getContextFilter();
if (filter == null) {
if (!children.validate(this)) return false;
set(null, children.getError(), children.getData());
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java
index 49f94a1bd..7042c63f5 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeRegister.java
@@ -60,7 +60,7 @@ public class TCFNodeRegister extends TCFNode implements IElementEditor {
context = new TCFData<IRegisters.RegistersContext>(channel) {
@Override
protected boolean startDataRetrieval() {
- IRegisters regs = model.getLaunch().getService(IRegisters.class);
+ IRegisters regs = launch.getService(IRegisters.class);
command = regs.getContext(id, new IRegisters.DoneGetContext() {
public void doneGetContext(IToken token, Exception error, IRegisters.RegistersContext context) {
set(token, error, context);
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
index 0a6ac5882..3d8902620 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java
@@ -74,7 +74,7 @@ public class TCFNodeStackFrame extends TCFNode {
set(null, null, null);
return true;
}
- IStackTrace st = model.getLaunch().getService(IStackTrace.class);
+ IStackTrace st = launch.getService(IStackTrace.class);
if (st == null) {
assert frame_no == 0;
set(null, null, null);
@@ -394,8 +394,12 @@ public class TCFNodeStackFrame extends TCFNode {
void postAllChangedDelta() {
for (TCFModelProxy p : model.getModelProxies()) {
int flags = 0;
- String id = p.getPresentationContext().getId();
- if (IDebugUIConstants.ID_DEBUG_VIEW.equals(id)) flags |= IModelDelta.STATE;
+ String view_id = p.getPresentationContext().getId();
+ if (IDebugUIConstants.ID_DEBUG_VIEW.equals(view_id) &&
+ (launch.getContextActionsCount(parent.id) == 0 ||
+ !model.getDelayStackUpdateUtilLastStep())) {
+ flags |= IModelDelta.STATE;
+ }
if (getChildren(p.getPresentationContext()) != null && p.getInput() == this) flags |= IModelDelta.CONTENT;
if (flags == 0) continue;
p.addDelta(this, flags);
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeSymbol.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeSymbol.java
index 81e54c3c7..eaed4129e 100644
--- a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeSymbol.java
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeSymbol.java
@@ -36,7 +36,7 @@ public class TCFNodeSymbol extends TCFNode {
context = new TCFData<ISymbols.Symbol>(channel) {
@Override
protected boolean startDataRetrieval() {
- ISymbols syms = model.getLaunch().getService(ISymbols.class);
+ ISymbols syms = launch.getService(ISymbols.class);
if (id == null || syms == null) {
set(null, null, null);
return true;
@@ -54,7 +54,7 @@ public class TCFNodeSymbol extends TCFNode {
children = new TCFData<String[]>(channel) {
@Override
protected boolean startDataRetrieval() {
- ISymbols syms = model.getLaunch().getService(ISymbols.class);
+ ISymbols syms = launch.getService(ISymbols.class);
if (id == null || syms == null) {
set(null, null, null);
return true;
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/DecoratingIntegerFieldEditor.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/DecoratingIntegerFieldEditor.java
new file mode 100644
index 000000000..52348b447
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/DecoratingIntegerFieldEditor.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
+ * 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.internal.tcf.debug.ui.preferences;
+
+import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.fieldassist.FieldDecoration;
+import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * An {@link IntegerFieldEditor} with field decoration.
+ *
+ * @since 1.1
+ */
+public class DecoratingIntegerFieldEditor extends IntegerFieldEditor {
+
+ private ControlDecoration fDecoration;
+
+ protected DecoratingIntegerFieldEditor() {
+ }
+
+ /**
+ * Creates an integer field editor.
+ *
+ * @param name
+ * the name of the preference this field editor works on
+ * @param labelText
+ * the label text of the field editor
+ * @param parent
+ * the parent of the field editor's control
+ */
+ public DecoratingIntegerFieldEditor(String name, String labelText,
+ Composite parent) {
+ super(name, labelText, parent);
+ }
+
+ /**
+ * Creates an integer field editor.
+ *
+ * @param name
+ * the name of the preference this field editor works on
+ * @param labelText
+ * the label text of the field editor
+ * @param parent
+ * the parent of the field editor's control
+ * @param textLimit
+ * the maximum number of characters in the text.
+ */
+ public DecoratingIntegerFieldEditor(String name, String labelText,
+ Composite parent, int textLimit) {
+ super(name, labelText, parent, textLimit);
+ }
+
+ @Override
+ public Text getTextControl(Composite parent) {
+ Text control = super.getTextControl(parent);
+ if (fDecoration == null) {
+ fDecoration = new ControlDecoration(control, SWT.LEFT | SWT.TOP);
+ FieldDecoration errorDecoration = FieldDecorationRegistry
+ .getDefault().getFieldDecoration(
+ FieldDecorationRegistry.DEC_ERROR);
+ fDecoration.setImage(errorDecoration.getImage());
+ fDecoration.setDescriptionText(getErrorMessage());
+
+ // validate on focus gain
+ control.addFocusListener(new FocusAdapter() {
+ @Override
+ public void focusGained(FocusEvent e) {
+ refreshValidState();
+ }
+ });
+ }
+ return control;
+ }
+
+ @Override
+ protected void showErrorMessage(String msg) {
+ super.showErrorMessage(msg);
+ if (fDecoration != null) {
+ fDecoration.setDescriptionText(msg);
+ fDecoration.show();
+ }
+ }
+
+ @Override
+ protected void clearErrorMessage() {
+ super.clearErrorMessage();
+ if (fDecoration != null) {
+ fDecoration.hide();
+ }
+ }
+
+}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/IntegerWithBooleanFieldEditor.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/IntegerWithBooleanFieldEditor.java
new file mode 100644
index 000000000..a0f39bb16
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/IntegerWithBooleanFieldEditor.java
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2009 Wind River Systems, Inc. and others.
+ * 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.internal.tcf.debug.ui.preferences;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * An integer field editor with an enablement check box.
+ */
+public class IntegerWithBooleanFieldEditor extends DecoratingIntegerFieldEditor {
+
+ private final String fEnableKey;
+
+ private Button fCheckbox;
+
+ private boolean fWasSelected;
+
+ public IntegerWithBooleanFieldEditor(String enableKey, String nameKey,
+ String labelText, Composite parent) {
+ super(nameKey, labelText, parent);
+ fEnableKey = enableKey;
+ }
+
+ public IntegerWithBooleanFieldEditor(String enableKey, String nameKey,
+ String labelText, Composite parent, int textLimit) {
+ super(nameKey, labelText, parent, textLimit);
+ fEnableKey = enableKey;
+ }
+
+ @Override
+ protected void doFillIntoGrid(Composite parent, int numColumns) {
+ getCheckboxControl(parent);
+ super.doFillIntoGrid(parent, numColumns);
+ }
+
+ private Button getCheckboxControl(Composite parent) {
+ if (fCheckbox == null) {
+ Composite inner = new Composite(parent, SWT.NULL);
+ final GridLayout layout = new GridLayout(2, false);
+ layout.marginWidth = 0;
+ inner.setLayout(layout);
+ fCheckbox = new Button(inner, SWT.CHECK);
+ fCheckbox.setFont(parent.getFont());
+ fCheckbox.setText(getLabelText());
+ // create and hide label from base class
+ Label label = getLabelControl(inner);
+ label.setText(""); //$NON-NLS-1$
+ label.setVisible(false);
+ fCheckbox.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ boolean isSelected = fCheckbox.getSelection();
+ valueChanged(fWasSelected, isSelected);
+ fWasSelected = isSelected;
+ }
+ });
+ }
+ else {
+ checkParent(fCheckbox.getParent(), parent);
+ }
+ return fCheckbox;
+ }
+
+ @Override
+ public Label getLabelControl(Composite parent) {
+ final Label label = getLabelControl();
+ if (label == null) {
+ return super.getLabelControl(parent);
+ }
+ else {
+ checkParent(label.getParent(), parent);
+ }
+ return label;
+ }
+
+ protected void valueChanged(boolean oldValue, boolean newValue) {
+ if (oldValue != newValue) {
+ valueChanged();
+ fireStateChanged(VALUE, oldValue, newValue);
+ getTextControl().setEnabled(newValue);
+ getLabelControl().setEnabled(newValue);
+ }
+ }
+
+ @Override
+ protected boolean checkState() {
+ if (fCheckbox != null && !fCheckbox.getSelection()) {
+ clearErrorMessage();
+ return true;
+ }
+ return super.checkState();
+ }
+
+ @Override
+ protected void doLoad() {
+ super.doLoad();
+ if (fCheckbox != null) {
+ boolean value = getPreferenceStore().getBoolean(fEnableKey);
+ fCheckbox.setSelection(value);
+ fWasSelected = value;
+ getTextControl().setEnabled(value);
+ getLabelControl().setEnabled(value);
+ }
+ }
+
+ @Override
+ protected void doLoadDefault() {
+ super.doLoadDefault();
+ if (fCheckbox != null) {
+ boolean value = getPreferenceStore().getDefaultBoolean(fEnableKey);
+ fCheckbox.setSelection(value);
+ fWasSelected = value;
+ getTextControl().setEnabled(value);
+ getLabelControl().setEnabled(value);
+ }
+ }
+
+ @Override
+ protected void doStore() {
+ super.doStore();
+ getPreferenceStore().setValue(fEnableKey, fCheckbox.getSelection());
+ }
+
+ /**
+ * Returns this field editor's current boolean value.
+ *
+ * @return the value
+ */
+ public boolean getBooleanValue() {
+ return fCheckbox.getSelection();
+ }
+}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFDebugPreferencePage.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFDebugPreferencePage.java
new file mode 100644
index 000000000..fe9cc6332
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFDebugPreferencePage.java
@@ -0,0 +1,125 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others.
+ * 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.internal.tcf.debug.ui.preferences;
+
+import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.FieldEditorPreferencePage;
+import org.eclipse.jface.preference.IntegerFieldEditor;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+public class TCFDebugPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
+
+ public TCFDebugPreferencePage() {
+ super(FLAT);
+ setPreferenceStore(TCFPreferences.getPreferenceStore());
+ setDescription("General settings for debuggers using Target Communication Framework (TCF)");
+ }
+
+ public void init(IWorkbench workbench) {
+ }
+
+ @Override
+ protected void createFieldEditors() {
+ Composite parent = getFieldEditorParent();
+ GridLayout layout = new GridLayout();
+ layout.marginWidth = 0;
+ parent.setLayout(layout);
+
+ createPerformanceGroup(parent);
+ }
+
+ private void createPerformanceGroup(Composite parent) {
+ Group group = new Group(parent, SWT.NONE);
+ group.setText("Performance");
+ GridLayout layout = new GridLayout(3, false);
+ group.setLayout(layout);
+ group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
+ /* TODO: stack limit
+ IntegerFieldEditor limitEditor = new IntegerWithBooleanFieldEditor(
+ TCFPreferences.PREF_STACK_FRAME_LIMIT_ENABLED,
+ TCFPreferences.PREF_STACK_FRAME_LIMIT_VALUE,
+ "Limit number of stack frames to",
+ group);
+
+ limitEditor.setValidRange(1, Integer.MAX_VALUE);
+ limitEditor.setValidateStrategy(IntegerWithBooleanFieldEditor.VALIDATE_ON_FOCUS_LOST);
+ limitEditor.fillIntoGrid(group, 3);
+ addField(limitEditor);
+ */
+
+ BooleanFieldEditor syncSteppingEditor = new BooleanFieldEditor(
+ TCFPreferences.PREF_WAIT_FOR_PC_UPDATE_AFTER_STEP,
+ "Wait for editor marker to update after every step",
+ group);
+
+ syncSteppingEditor.fillIntoGrid(group, 3);
+ addField(syncSteppingEditor);
+
+ BooleanFieldEditor syncViewsEditor = new BooleanFieldEditor(
+ TCFPreferences.PREF_WAIT_FOR_VIEWS_UPDATE_AFTER_STEP,
+ "Wait for views to update after every step",
+ group);
+
+ syncViewsEditor.fillIntoGrid(group, 3);
+ addField(syncViewsEditor);
+
+ BooleanFieldEditor delayStackEditor = new BooleanFieldEditor(
+ TCFPreferences.PREF_DELAY_STACK_UPDATE_UNTIL_LAST_STEP,
+ "Delay stack trace update util last step",
+ group);
+
+ delayStackEditor.fillIntoGrid(group, 3);
+ addField(delayStackEditor);
+
+ IntegerFieldEditor minStepIntervalEditor = new DecoratingIntegerFieldEditor(
+ TCFPreferences.PREF_MIN_STEP_INTERVAL,
+ "Minimum interval between steps (in milliseconds)",
+ group);
+
+ minStepIntervalEditor.setValidRange(0, 10000);
+ minStepIntervalEditor.fillIntoGrid(group, 3);
+ addField(minStepIntervalEditor);
+
+ IntegerFieldEditor minUpdateIntervalEditor = new DecoratingIntegerFieldEditor(
+ TCFPreferences.PREF_MIN_UPDATE_INTERVAL,
+ "Minimum interval between view updates (in milliseconds)",
+ group);
+
+ minUpdateIntervalEditor.setValidRange(0, 10000);
+ minUpdateIntervalEditor.fillIntoGrid(group, 3);
+ addField(minUpdateIntervalEditor);
+
+ BooleanFieldEditor updatesThrottleEditor = new BooleanFieldEditor(
+ TCFPreferences.PREF_VIEW_UPDATES_THROTTLE,
+ "Reduce views updates frequency during UI jobs congestion",
+ group);
+
+ updatesThrottleEditor.fillIntoGrid(group, 3);
+ addField(updatesThrottleEditor);
+
+ BooleanFieldEditor trafficThrottleEditor = new BooleanFieldEditor(
+ TCFPreferences.PREF_TARGET_TRAFFIC_THROTTLE,
+ "Reduce data requests frequency during target traffic congestion",
+ group);
+
+ trafficThrottleEditor.fillIntoGrid(group, 3);
+ addField(trafficThrottleEditor);
+
+ group.setLayout(layout);
+ }
+}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferences.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferences.java
new file mode 100644
index 000000000..444daaf1e
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferences.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others.
+ * 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.internal.tcf.debug.ui.preferences;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.tm.internal.tcf.debug.ui.Activator;
+
+public class TCFPreferences {
+
+ public static final String
+ PREF_STACK_FRAME_LIMIT_ENABLED = "StackFrameLimitEnabled",
+ PREF_STACK_FRAME_LIMIT_VALUE = "StackFrameLimitValue",
+ PREF_WAIT_FOR_PC_UPDATE_AFTER_STEP = "WaitForPCUpdateAfterStep",
+ PREF_WAIT_FOR_VIEWS_UPDATE_AFTER_STEP = "WaitForViewsUpdateAfterStep",
+ PREF_DELAY_STACK_UPDATE_UNTIL_LAST_STEP = "DelayStackUpdateUntilLastStep",
+ PREF_MIN_STEP_INTERVAL = "MinStepInterval",
+ PREF_MIN_UPDATE_INTERVAL = "MinUpdateInterval",
+ PREF_VIEW_UPDATES_THROTTLE = "ViewUpdatesThrottle",
+ PREF_TARGET_TRAFFIC_THROTTLE = "TargetTrafficThrottle";
+
+ public static IPreferenceStore getPreferenceStore() {
+ return Activator.getDefault().getPreferenceStore();
+ }
+}
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferencesInitializer.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferencesInitializer.java
new file mode 100644
index 000000000..0e2873610
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferencesInitializer.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Wind River Systems, Inc. and others.
+ * 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
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tm.internal.tcf.debug.ui.preferences;
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+
+public class TCFPreferencesInitializer extends AbstractPreferenceInitializer {
+
+ @Override
+ public void initializeDefaultPreferences() {
+ IPreferenceStore prefs = TCFPreferences.getPreferenceStore();
+
+ prefs.setDefault(TCFPreferences.PREF_STACK_FRAME_LIMIT_ENABLED, false);
+ prefs.setDefault(TCFPreferences.PREF_STACK_FRAME_LIMIT_VALUE, 10);
+ prefs.setDefault(TCFPreferences.PREF_WAIT_FOR_PC_UPDATE_AFTER_STEP, true);
+ prefs.setDefault(TCFPreferences.PREF_WAIT_FOR_VIEWS_UPDATE_AFTER_STEP, false);
+ prefs.setDefault(TCFPreferences.PREF_DELAY_STACK_UPDATE_UNTIL_LAST_STEP, false);
+ prefs.setDefault(TCFPreferences.PREF_MIN_STEP_INTERVAL, 50);
+ prefs.setDefault(TCFPreferences.PREF_MIN_UPDATE_INTERVAL, 50);
+ prefs.setDefault(TCFPreferences.PREF_VIEW_UPDATES_THROTTLE, true);
+ prefs.setDefault(TCFPreferences.PREF_TARGET_TRAFFIC_THROTTLE, true);
+ }
+}

Back to the top