Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2012-09-25 21:13:06 +0000
committerEugene Tarassov2012-09-25 21:13:06 +0000
commit4423721302a17bac76bd3d85264ebc7e84b30236 (patch)
treee8addd7bf170cb1a918cda1d101630afe99927ba /plugins
parent240a003b7af372d0d0094b0a175fb93616a6e81b (diff)
downloadorg.eclipse.tcf-4423721302a17bac76bd3d85264ebc7e84b30236.tar.gz
org.eclipse.tcf-4423721302a17bac76bd3d85264ebc7e84b30236.tar.xz
org.eclipse.tcf-4423721302a17bac76bd3d85264ebc7e84b30236.zip
TCF Debugger: fixed: invalid symbols data could lock debugger UI
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/BreakpointCommand.java7
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFNodeExpression.java8
2 files changed, 12 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/BreakpointCommand.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/BreakpointCommand.java
index 983132ab8..706f889e9 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/BreakpointCommand.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/BreakpointCommand.java
@@ -19,6 +19,7 @@ import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetExtension;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.tcf.internal.debug.model.TCFBreakpoint;
+import org.eclipse.tcf.internal.debug.ui.model.TCFNode;
import org.eclipse.tcf.internal.debug.ui.model.TCFNodeExecContext;
import org.eclipse.tcf.internal.debug.ui.model.TCFNodeStackFrame;
import org.eclipse.tcf.services.IBreakpoints;
@@ -32,7 +33,8 @@ public class BreakpointCommand implements IToggleBreakpointsTargetExtension {
public boolean canToggleBreakpoints(IWorkbenchPart part, ISelection selection) {
if (selection.isEmpty()) return false;
final Object obj = ((IStructuredSelection)selection).getFirstElement();
- return new TCFTask<Boolean>() {
+ if (!(obj instanceof TCFNode)) return false;
+ return new TCFTask<Boolean>(((TCFNode)obj).getChannel()) {
public void run() {
TCFDataCache<BigInteger> addr_cache = null;
if (obj instanceof TCFNodeExecContext) addr_cache = ((TCFNodeExecContext)obj).getAddress();
@@ -51,7 +53,8 @@ public class BreakpointCommand implements IToggleBreakpointsTargetExtension {
public void toggleBreakpoints(IWorkbenchPart part, ISelection selection) {
if (selection.isEmpty()) return;
final Object obj = ((IStructuredSelection)selection).getFirstElement();
- new TCFTask<Object>() {
+ if (!(obj instanceof TCFNode)) return;
+ new TCFTask<Object>(((TCFNode)obj).getChannel()) {
public void run() {
TCFDataCache<BigInteger> addr_cache = null;
if (obj instanceof TCFNodeExecContext) addr_cache = ((TCFNodeExecContext)obj).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 e1a3b016d..ef84e310d 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
@@ -918,6 +918,12 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
if (!get_base_type) break;
+ if (name.length() > 0x1000) {
+ /* Must be invalid symbols data */
+ name = "<Unknown>";
+ break;
+ }
+
type_cache = model.getSymbolInfoCache(type_symbol.getBaseTypeID());
if (type_cache == null) {
name = "<Unknown> " + name;
@@ -1638,7 +1644,7 @@ public class TCFNodeExpression extends TCFNode implements IElementEditor, ICastT
public boolean canModify(Object element, final String property) {
final TCFNodeExpression node = (TCFNodeExpression)element;
- return new TCFTask<Boolean>() {
+ return new TCFTask<Boolean>(node.channel) {
public void run() {
if (TCFColumnPresentationExpression.COL_NAME.equals(property)) {
done(node.is_empty || node.script != null);

Back to the top