Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2013-03-12 13:25:52 -0400
committerEugene Tarassov2013-03-12 13:25:52 -0400
commita3061a15550bdf00af2890ddc2f942386c87d617 (patch)
tree7c9a444d492463d526c98a7d36dfed8927433876
parent4f187a69cfb504d4ab5ed78cc87d1bee3419f9f6 (diff)
downloadorg.eclipse.tcf-a3061a15550bdf00af2890ddc2f942386c87d617.tar.gz
org.eclipse.tcf-a3061a15550bdf00af2890ddc2f942386c87d617.tar.xz
org.eclipse.tcf-a3061a15550bdf00af2890ddc2f942386c87d617.zip
TCF Debugger: fixed: a function call in the Expressions view can lock UI if the function does not return
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ViewMemoryCommand.java20
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java18
2 files changed, 37 insertions, 1 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ViewMemoryCommand.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ViewMemoryCommand.java
index 9099c406c..256c83d3a 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ViewMemoryCommand.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/ViewMemoryCommand.java
@@ -18,6 +18,7 @@ import org.eclipse.debug.core.model.IMemoryBlock;
import org.eclipse.debug.core.model.IMemoryBlockRetrievalExtension;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.tcf.internal.debug.ui.Activator;
import org.eclipse.tcf.internal.debug.ui.model.TCFModel;
import org.eclipse.tcf.internal.debug.ui.model.TCFModelProxy;
@@ -41,6 +42,18 @@ public class ViewMemoryCommand extends AbstractActionDelegate {
long size;
}
+ private final Runnable on_value_changed = new Runnable() {
+ @Override
+ public void run() {
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ selectionChanged();
+ }
+ });
+ }
+ };
+
private Block getBlockInfo(final TCFNode node) {
try {
return new TCFTask<Block>(node.getChannel()) {
@@ -52,7 +65,12 @@ public class ViewMemoryCommand extends AbstractActionDelegate {
long size = -1;
if (node instanceof TCFNodeExpression) {
TCFDataCache<IExpressions.Value> val_cache = ((TCFNodeExpression)node).getValue();
- if (!val_cache.validate(this)) return;
+ if (!val_cache.validate(on_value_changed)) {
+ /* Don't wait until the value is evaluated -
+ * it can take long time if the expression contains a function call. */
+ done(null);
+ return;
+ }
IExpressions.Value val_data = val_cache.getData();
if (val_data != null) {
addr = JSON.toBigInteger(val_data.getAddress());
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java
index e67a7e3ba..4eb74ab5f 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java
@@ -83,6 +83,13 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
private static int expr_cnt;
+ private final Runnable post_delta = new Runnable() {
+ @Override
+ public void run() {
+ postAllChangedDelta();
+ }
+ };
+
TCFNodeExpression(final TCFNode parent, final String script,
final String field_id, final String var_id, final String reg_id,
final int index, final boolean deref) {
@@ -1117,6 +1124,17 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
if (!value.validate()) pending = value;
if (!type.validate()) pending = type;
if (pending != null) {
+ if (script != null) {
+ if (!rem_expression.validate(done)) return false;
+ IExpressions.Expression exp_data = rem_expression.getData();
+ if (exp_data != null && exp_data.hasFuncCall()) {
+ /* Don't wait, it can take very long time */
+ pending.wait(post_delta);
+ result.setForeground(ColorCache.rgb_disabled, 0);
+ result.setLabel(script + " (Running)", 0);
+ return true;
+ }
+ }
pending.wait(done);
return false;
}

Back to the top