Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2011-08-08 19:59:13 -0400
committereutarass2011-08-08 19:59:13 -0400
commitc41c6fa69a6058aa9e28fc74a4fc75898fb375b2 (patch)
tree695bf911fb40ec083429b7b1fdcadd09e4439419 /plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse
parent7eab7011bcd5a0c59bff2d087dc515a9eb48fe3e (diff)
downloadorg.eclipse.tcf-c41c6fa69a6058aa9e28fc74a4fc75898fb375b2.tar.gz
org.eclipse.tcf-c41c6fa69a6058aa9e28fc74a4fc75898fb375b2.tar.xz
org.eclipse.tcf-c41c6fa69a6058aa9e28fc74a4fc75898fb375b2.zip
TCF Debugger: implemented adapter for CDT breakpoint actions.
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/TCFChildrenLogExpressions.java63
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExecContext.java11
-rw-r--r--plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFNodeExpression.java10
3 files changed, 82 insertions, 2 deletions
diff --git a/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenLogExpressions.java b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenLogExpressions.java
new file mode 100644
index 000000000..44a468a4c
--- /dev/null
+++ b/plugins/org.eclipse.tm.tcf.debug.ui/src/org/eclipse/tm/internal/tcf/debug/ui/model/TCFChildrenLogExpressions.java
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * 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.model;
+
+import java.util.HashMap;
+import java.util.HashSet;
+
+public class TCFChildrenLogExpressions extends TCFChildren {
+
+ private final HashSet<String> scripts = new HashSet<String>();
+
+ TCFChildrenLogExpressions(TCFNodeExecContext node) {
+ super(node, 16);
+ }
+
+ void onSuspended() {
+ for (TCFNode n : getNodes()) ((TCFNodeExpression)n).onSuspended();
+ scripts.clear();
+ reset();
+ }
+
+ void onRegisterValueChanged() {
+ for (TCFNode n : getNodes()) ((TCFNodeExpression)n).onRegisterValueChanged();
+ }
+
+ void onMemoryChanged() {
+ for (TCFNode n : getNodes()) ((TCFNodeExpression)n).onMemoryChanged();
+ }
+
+ public TCFNodeExpression findScript(String script) {
+ for (TCFNode n : getNodes()) {
+ TCFNodeExpression e = (TCFNodeExpression)n;
+ if (script.equals(e.getScript())) return e;
+ }
+ return null;
+ }
+
+ public void addScript(String script) {
+ if (scripts.add(script)) reset();
+ }
+
+ @Override
+ protected boolean startDataRetrieval() {
+ HashMap<String,TCFNode> data = new HashMap<String,TCFNode>();
+ for (String script : scripts) {
+ TCFNodeExpression expression_node = findScript(script);
+ if (expression_node == null) {
+ add(expression_node = new TCFNodeExpression(node, script, null, null, -1, false));
+ }
+ data.put(expression_node.id, expression_node);
+ }
+ set(null, null, data);
+ return true;
+ }
+}
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 d21a745ef..197bb542b 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
@@ -51,6 +51,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
private final TCFChildrenRegisters children_regs;
private final TCFChildrenExpressions children_exps;
private final TCFChildrenHoverExpressions children_hover_exps;
+ private final TCFChildrenLogExpressions children_log_exps;
private final TCFChildrenModules children_modules;
private final TCFData<IMemory.MemoryContext> mem_context;
@@ -215,6 +216,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
children_regs = new TCFChildrenRegisters(this);
children_exps = new TCFChildrenExpressions(this);
children_hover_exps = new TCFChildrenHoverExpressions(this);
+ children_log_exps = new TCFChildrenLogExpressions(this);
children_modules = new TCFChildrenModules(this);
mem_context = new TCFData<IMemory.MemoryContext>(channel) {
@Override
@@ -487,6 +489,10 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
return hover_expression;
}
+ public TCFChildrenLogExpressions getLogExpressionCache() {
+ return children_log_exps;
+ }
+
void setRunContext(IRunControl.RunControlContext ctx) {
run_context.reset(ctx);
}
@@ -1225,6 +1231,7 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
children_regs.onSuspended();
children_exps.onSuspended();
children_hover_exps.onSuspended();
+ children_log_exps.onSuspended();
for (TCFNodeSymbol s : symbols.values()) s.onExeStateChange();
if (model.getActiveAction(id) == null) {
boolean update_now = pc != null || resumed_by_action;
@@ -1288,6 +1295,8 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
children_exec.onMemoryChanged(addr, size);
children_stack.onMemoryChanged();
children_exps.onMemoryChanged();
+ children_hover_exps.onMemoryChanged();
+ children_log_exps.onMemoryChanged();
postContentChangedDelta();
}
@@ -1314,6 +1323,8 @@ public class TCFNodeExecContext extends TCFNode implements ISymbolOwner {
address.reset();
children_stack.onRegisterValueChanged();
children_exps.onRegisterValueChanged();
+ children_hover_exps.onRegisterValueChanged();
+ children_log_exps.onRegisterValueChanged();
postContentChangedDelta();
}
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 80e1d4554..8497d124c 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
@@ -1213,7 +1213,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
return name;
}
- String getDetailText(Runnable done) {
+ public String getDetailText(Runnable done) {
if (!expression.validate(done)) return null;
if (!value.validate(done)) return null;
StringBuffer bf = new StringBuffer();
@@ -1249,7 +1249,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
return bf.toString();
}
- String getValueText(Runnable done) {
+ public String getValueText(Runnable done) {
if (!expression.validate(done)) return null;
if (!value.validate(done)) return null;
StringBuffer bf = new StringBuffer();
@@ -1262,6 +1262,12 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
data, 0, data.length, big_endian, done)) return null;
}
}
+ if (bf.length() == 0 && expression.getError() != null) {
+ bf.append(TCFModel.getErrorMessage(expression.getError(), false));
+ }
+ if (bf.length() == 0 && value.getError() != null) {
+ bf.append(TCFModel.getErrorMessage(value.getError(), false));
+ }
return bf.toString();
}

Back to the top