Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-10-18 20:08:47 +0000
committerPawel Piech2012-10-19 17:10:02 +0000
commit6494aa1049a4d05346e6dbd2f14b44c3ce0a0feb (patch)
treee885b1ddb983a65578020ef289ca168c50f2786c /plugins
parent95addf002e9cf536bc0b4de64854632d91cf6bfe (diff)
downloadorg.eclipse.tcf-6494aa1049a4d05346e6dbd2f14b44c3ce0a0feb.tar.gz
org.eclipse.tcf-6494aa1049a4d05346e6dbd2f14b44c3ce0a0feb.tar.xz
org.eclipse.tcf-6494aa1049a4d05346e6dbd2f14b44c3ce0a0feb.zip
Bug 392380 - [memory] User can create a memory block on an element that doesn't have a memory context.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java2
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFMemoryBlockRetrieval.java16
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java13
3 files changed, 22 insertions, 9 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java
index 609c99c6e..a00089654 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFDebugTask.java
@@ -47,7 +47,7 @@ public abstract class TCFDebugTask<V> extends TCFTask<V> {
if (x instanceof DebugException) throw (DebugException)x;
if (x != null) throw new DebugException(new Status(
IStatus.ERROR, Activator.PLUGIN_ID, DebugException.REQUEST_FAILED,
- "Debugger request failed", x));
+ "Debugger request failed.\n " + x.getMessage(), x));
return getResult();
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFMemoryBlockRetrieval.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFMemoryBlockRetrieval.java
index 2a973c245..a3017910d 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFMemoryBlockRetrieval.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFMemoryBlockRetrieval.java
@@ -41,8 +41,8 @@ import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IExpressions;
import org.eclipse.tcf.services.IMemory;
-import org.eclipse.tcf.services.ISymbols;
import org.eclipse.tcf.services.IMemory.MemoryError;
+import org.eclipse.tcf.services.ISymbols;
import org.eclipse.tcf.util.TCFDataCache;
/**
@@ -547,7 +547,12 @@ class TCFMemoryBlockRetrieval implements IMemoryBlockRetrievalExtension {
public IMemoryBlockExtension getExtendedMemoryBlock(final String expression, Object context) throws DebugException {
return new TCFDebugTask<IMemoryBlockExtension>() {
public void run() {
- done(new MemoryBlock(expression, -1));
+ if (!exec_ctx.getMemoryContext().validate(this)) return;
+ if (exec_ctx.getMemoryContext().getError() != null) {
+ error(exec_ctx.getMemoryContext().getError());
+ } else {
+ done(new MemoryBlock(expression, -1));
+ }
}
}.getD();
}
@@ -555,7 +560,12 @@ class TCFMemoryBlockRetrieval implements IMemoryBlockRetrievalExtension {
public IMemoryBlock getMemoryBlock(final long address, final long length) throws DebugException {
return new TCFDebugTask<IMemoryBlockExtension>() {
public void run() {
- done(new MemoryBlock("0x" + Long.toHexString(address), length));
+ if (!exec_ctx.getMemoryContext().validate(this)) return;
+ if (exec_ctx.getMemoryContext().getError() != null) {
+ error(exec_ctx.getMemoryContext().getError());
+ } else {
+ done(new MemoryBlock("0x" + Long.toHexString(address), length));
+ }
}
}.getD();
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
index 7c38ec379..0107e18f3 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFModel.java
@@ -753,11 +753,14 @@ public class TCFModel implements ITCFModel, IElementContentProvider, IElementLab
if (!cache.validate(this)) return;
if (cache.getData() != null) {
TCFNodeExecContext ctx = cache.getData();
- o = mem_retrieval.get(ctx.id);
- if (o == null) {
- TCFMemoryBlockRetrieval m = new TCFMemoryBlockRetrieval(ctx);
- mem_retrieval.put(ctx.id, m);
- o = m;
+ if (!ctx.getMemoryContext().validate(this)) return;
+ if (ctx.getMemoryContext().getError() == null) {
+ o = mem_retrieval.get(ctx.id);
+ if (o == null) {
+ TCFMemoryBlockRetrieval m = new TCFMemoryBlockRetrieval(ctx);
+ mem_retrieval.put(ctx.id, m);
+ o = m;
+ }
}
}
}

Back to the top