Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-08-25 20:04:32 -0400
committereutarass2011-08-25 20:04:32 -0400
commitd3a7c87169c0c74c4d88b1757ab9ca7257afbb2e (patch)
tree18a865bff1a53dac3d697185262544deb9ec1296 /plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse
parente700f95ef3e620abe727358760aa371eefc55d8b (diff)
downloadorg.eclipse.tcf-d3a7c87169c0c74c4d88b1757ab9ca7257afbb2e.tar.gz
org.eclipse.tcf-d3a7c87169c0c74c4d88b1757ab9ca7257afbb2e.tar.xz
org.eclipse.tcf-d3a7c87169c0c74c4d88b1757ab9ca7257afbb2e.zip
TCF Debugger: implemented new debugger preference: Automatic children list updates in the Debug View
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.java6
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java88
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeStackFrame.java4
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFDebugPreferencePage.java12
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferences.java1
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/preferences/TCFPreferencesInitializer.java1
6 files changed, 89 insertions, 23 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 74bd94acf..6be8b25e1 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
@@ -195,6 +195,7 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
private boolean show_function_arg_names;
private boolean show_function_arg_values;
private boolean delay_children_list_updates;
+ private boolean auto_children_list_updates;
private final Map<String,String> action_results = new HashMap<String,String>();
private final HashMap<String,TCFAction> active_actions = new HashMap<String,TCFAction>();
@@ -627,6 +628,7 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
stack_frames_limit_value = prefs.getInt(TCFPreferences.PREF_STACK_FRAME_LIMIT_VALUE);
show_function_arg_names = prefs.getBoolean(TCFPreferences.PREF_STACK_FRAME_ARG_NAMES);
show_function_arg_values = prefs.getBoolean(TCFPreferences.PREF_STACK_FRAME_ARG_VALUES);
+ auto_children_list_updates = prefs.getBoolean(TCFPreferences.PREF_AUTO_CHILDREN_LIST_UPDATES);
delay_children_list_updates = prefs.getBoolean(TCFPreferences.PREF_DELAY_CHILDREN_LIST_UPDATES);
Protocol.invokeLater(new Runnable() {
public void run() {
@@ -801,6 +803,10 @@ public class TCFModel implements IElementContentProvider, IElementLabelProvider,
return show_function_arg_values;
}
+ public boolean getAutoChildrenListUpdates() {
+ return auto_children_list_updates;
+ }
+
public boolean getDelayChildrenListUpdates() {
return delay_children_list_updates;
}
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 c216607c8..c3e0ee355 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
@@ -43,6 +43,7 @@ import org.eclipse.tm.tcf.services.IProcesses;
import org.eclipse.tm.tcf.services.IRunControl;
import org.eclipse.tm.tcf.services.ISymbols;
import org.eclipse.tm.tcf.util.TCFDataCache;
+import org.eclipse.ui.IViewPart;
public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
@@ -122,6 +123,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
private boolean resume_pending;
private boolean resumed_by_action;
private TCFNode[] last_stack_trace;
+ private TCFNode[] last_children_list;
private String last_label;
private ImageDescriptor last_image;
private ChildrenStateInfo last_children_state_info;
@@ -714,6 +716,11 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
return (TCFNodeStackFrame)last_stack_trace[0];
}
+ public TCFNodeStackFrame getViewBottomFrame() {
+ if (last_stack_trace == null || last_stack_trace.length == 0) return null;
+ return (TCFNodeStackFrame)last_stack_trace[last_stack_trace.length - 1];
+ }
+
/**
* Get context full name - including all ancestor names.
* Return context ID if the context does not have a name.
@@ -778,6 +785,10 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
children = children_stack;
}
else {
+ if (!model.getAutoChildrenListUpdates() && last_children_list != null) {
+ result.setChildCount(last_children_list.length);
+ return true;
+ }
children = children_exec;
}
}
@@ -804,6 +815,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
if (children != null) {
if (!children.validate(done)) return false;
if (children == children_stack) last_stack_trace = children_stack.toArray();
+ if (children == children_exec) last_children_list = children_exec.toArray();
result.setChildCount(children.size());
}
else {
@@ -812,6 +824,18 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
return true;
}
+ private void setResultChildren(IChildrenUpdate result, TCFNode[] arr) {
+ int offset = 0;
+ int r_offset = result.getOffset();
+ int r_length = result.getLength();
+ for (TCFNode n : arr) {
+ if (offset >= r_offset && offset < r_offset + r_length) {
+ result.setChild(n, offset);
+ }
+ offset++;
+ }
+ }
+
@Override
protected boolean getData(IChildrenUpdate result, Runnable done) {
TCFChildren children = null;
@@ -821,16 +845,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
IRunControl.RunControlContext ctx = run_context.getData();
if (ctx != null && ctx.hasState()) {
if (resume_pending && last_stack_trace != null) {
- TCFNode[] arr = last_stack_trace;
- int offset = 0;
- int r_offset = result.getOffset();
- int r_length = result.getLength();
- for (TCFNode n : arr) {
- if (offset >= r_offset && offset < r_offset + r_length) {
- result.setChild(n, offset);
- }
- offset++;
- }
+ setResultChildren(result, last_stack_trace);
return true;
}
if (!state.validate(done)) return false;
@@ -845,6 +860,10 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
children = children_stack;
}
else {
+ if (!model.getAutoChildrenListUpdates() && last_children_list != null) {
+ setResultChildren(result, last_children_list);
+ return true;
+ }
children = children_exec;
}
}
@@ -873,6 +892,10 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
if (!children.validate(done)) return false;
last_stack_trace = children_stack.toArray();
}
+ if (children == children_exec) {
+ if (!children.validate(done)) return false;
+ last_children_list = children_exec.toArray();
+ }
return children.getData(result, done);
}
@@ -902,6 +925,10 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
children = children_stack;
}
else {
+ if (!model.getAutoChildrenListUpdates() && last_children_list != null) {
+ result.setHasChilren(last_children_list.length > 0);
+ return true;
+ }
children = children_exec;
}
}
@@ -928,6 +955,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
if (children != null) {
if (!children.validate(done)) return false;
if (children == children_stack) last_stack_trace = children_stack.toArray();
+ if (children == children_exec) last_children_list = children_exec.toArray();
result.setHasChilren(children.size() > 0);
}
else {
@@ -1072,16 +1100,31 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
return true;
}
+ public void refresh(IViewPart view) {
+ last_children_list = null;
+ last_children_state_info = null;
+ last_stack_trace = null;
+ last_label = null;
+ last_image = null;
+ super.refresh(view);
+ }
+
void postAllChangedDelta() {
postContentChangedDelta();
postStateChangedDelta();
}
void postContextAddedDelta() {
- if (last_children_state_info != null && !last_children_state_info.suspended && model.getDelayChildrenListUpdates()) {
- // Delay content update until a child is suspended.
- delayed_children_list_delta = true;
- return;
+ if (last_children_state_info != null) {
+ if (!model.getAutoChildrenListUpdates()) {
+ // Manual manual updates.
+ return;
+ }
+ if (!last_children_state_info.suspended && model.getDelayChildrenListUpdates()) {
+ // Delay content update until a child is suspended.
+ delayed_children_list_delta = true;
+ return;
+ }
}
for (TCFModelProxy p : model.getModelProxies()) {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(p.getPresentationContext().getId())) {
@@ -1092,10 +1135,16 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
}
private void postContextRemovedDelta() {
- if (last_children_state_info != null && !last_children_state_info.suspended && model.getDelayChildrenListUpdates()) {
- // Delay content update until a child is suspended.
- delayed_children_list_delta = true;
- return;
+ if (last_children_state_info != null) {
+ if (!model.getAutoChildrenListUpdates()) {
+ // Manual manual updates.
+ return;
+ }
+ if (!last_children_state_info.suspended && model.getDelayChildrenListUpdates()) {
+ // Delay content update until a child is suspended.
+ delayed_children_list_delta = true;
+ return;
+ }
}
for (TCFModelProxy p : model.getModelProxies()) {
if (IDebugUIConstants.ID_DEBUG_VIEW.equals(p.getPresentationContext().getId())) {
@@ -1347,7 +1396,8 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
}
void onPreferencesChanged() {
- if (delayed_children_list_delta && !model.getDelayChildrenListUpdates()) postContentChangedDelta();
+ if (delayed_children_list_delta && !model.getDelayChildrenListUpdates() ||
+ model.getAutoChildrenListUpdates()) postContentChangedDelta();
children_stack.onPreferencesChanged();
postStackChangedDelta();
}
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 9616626bb..f6c21a448 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
@@ -229,7 +229,7 @@ public class TCFNodeStackFrame extends TCFNode {
}
boolean isTraceLimit() {
- return trace_limit;
+ return trace_limit && ((TCFNodeExecContext)parent).getViewBottomFrame() == this;
}
void riseTraceLimit() {
@@ -285,7 +285,7 @@ public class TCFNodeStackFrame extends TCFNode {
if (stack_trace_cache.getData().get(id) == null) {
result.setLabel("", 0);
}
- else if (trace_limit) {
+ else if (isTraceLimit()) {
result.setLabel("<select to see more frames>", 0);
}
else {
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
index 1f5766722..419732044 100644
--- 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
@@ -51,13 +51,21 @@ public class TCFDebugPreferencePage extends FieldEditorPreferencePage implements
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
BooleanFieldEditor autoThreadListUpdates = new BooleanFieldEditor(
- TCFPreferences.PREF_DELAY_CHILDREN_LIST_UPDATES,
- "Delay children list updates in the Debug View until a child context is suspended",
+ TCFPreferences.PREF_AUTO_CHILDREN_LIST_UPDATES,
+ "Automatic children list updates in the Debug View",
group);
autoThreadListUpdates.fillIntoGrid(group, 3);
addField(autoThreadListUpdates);
+ BooleanFieldEditor delayThreadListUpdates = new BooleanFieldEditor(
+ TCFPreferences.PREF_DELAY_CHILDREN_LIST_UPDATES,
+ "Delay children list updates in the Debug View until a child context is suspended",
+ group);
+
+ delayThreadListUpdates.fillIntoGrid(group, 3);
+ addField(delayThreadListUpdates);
+
BooleanFieldEditor syncSteppingEditor = new BooleanFieldEditor(
TCFPreferences.PREF_WAIT_FOR_PC_UPDATE_AFTER_STEP,
"Wait for editor marker to update after every step",
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
index 3e950c289..c651880b8 100644
--- 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
@@ -27,6 +27,7 @@ public class TCFPreferences {
PREF_MIN_UPDATE_INTERVAL = "MinUpdateInterval",
PREF_VIEW_UPDATES_THROTTLE = "ViewUpdatesThrottle",
PREF_TARGET_TRAFFIC_THROTTLE = "TargetTrafficThrottle",
+ PREF_AUTO_CHILDREN_LIST_UPDATES = "AutoChildrenListUpdates",
PREF_DELAY_CHILDREN_LIST_UPDATES = "DelayChildrenListUpdates";
public static IPreferenceStore 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
index 63dc82c36..39ebc88db 100644
--- 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
@@ -30,6 +30,7 @@ public class TCFPreferencesInitializer extends AbstractPreferenceInitializer {
prefs.setDefault(TCFPreferences.PREF_MIN_UPDATE_INTERVAL, 50);
prefs.setDefault(TCFPreferences.PREF_VIEW_UPDATES_THROTTLE, true);
prefs.setDefault(TCFPreferences.PREF_TARGET_TRAFFIC_THROTTLE, true);
+ prefs.setDefault(TCFPreferences.PREF_AUTO_CHILDREN_LIST_UPDATES, true);
prefs.setDefault(TCFPreferences.PREF_DELAY_CHILDREN_LIST_UPDATES, true);
}
}

Back to the top