Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2015-02-11 23:25:34 -0500
committerEugene Tarassov2015-02-11 23:25:34 -0500
commit4cc0b421397e32939b944beb9e436279607afbb0 (patch)
treeba23ac2622bb172c9d66957d6cfaba55393a2806 /plugins/org.eclipse.tcf.debug.ui
parent15864f555dd5b70b485484d1c1f61b2a5fe09f58 (diff)
downloadorg.eclipse.tcf-4cc0b421397e32939b944beb9e436279607afbb0.tar.gz
org.eclipse.tcf-4cc0b421397e32939b944beb9e436279607afbb0.tar.xz
org.eclipse.tcf-4cc0b421397e32939b944beb9e436279607afbb0.zip
TCF Core: new memory context properties: "AddressableUnitSize" and "DefaultWordSize"
Diffstat (limited to 'plugins/org.eclipse.tcf.debug.ui')
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java15
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/model/TCFMemoryBlockRetrieval.java26
2 files changed, 38 insertions, 3 deletions
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java
index 9df910a84..55aeaf853 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/adapters/TCFNodePropertySource.java
@@ -37,6 +37,7 @@ import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.protocol.JSON;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IExpressions;
+import org.eclipse.tcf.services.IMemory;
import org.eclipse.tcf.services.IRegisters;
import org.eclipse.tcf.services.IRunControl;
import org.eclipse.tcf.services.IStackTrace;
@@ -245,10 +246,22 @@ public class TCFNodePropertySource implements IPropertySource {
}
private void getExecContextDescriptors(TCFNodeExecContext exe_node) {
+ TCFDataCache<IMemory.MemoryContext> mem_cache = exe_node.getMemoryContext();
TCFDataCache<IRunControl.RunControlContext> ctx_cache = exe_node.getRunContext();
TCFDataCache<TCFContextState> state_cache = exe_node.getState();
TCFDataCache<MemoryRegion[]> mem_map_cache = exe_node.getMemoryMap();
- if (!validateAll(ctx_cache, state_cache, mem_map_cache)) return;
+ if (!validateAll(mem_cache, ctx_cache, state_cache, mem_map_cache)) return;
+ IMemory.MemoryContext mem = mem_cache.getData();
+ if (mem != null) {
+ Map<String,Object> props = mem.getProperties();
+ for (String key : props.keySet()) {
+ Object value = props.get(key);
+ if (value instanceof Number) {
+ value = toHexAddrString((Number)value);
+ }
+ addDescriptor("Memory", key, value);
+ }
+ }
IRunControl.RunControlContext ctx = ctx_cache.getData();
if (ctx != null) {
Map<String,Object> props = ctx.getProperties();
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 ea6e4f46d..0e85aa80d 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
@@ -256,8 +256,30 @@ class TCFMemoryBlockRetrieval implements IMemoryBlockRetrievalExtension {
@Override
public int getAddressableSize() throws DebugException {
- // TODO: support for addressable size other then 1 byte
- return 1;
+ return new TCFDebugTask<Integer>(exec_ctx.getChannel()) {
+ @Override
+ public void run() {
+ if (exec_ctx.isDisposed()) {
+ error("Context is disposed");
+ }
+ else {
+ TCFDataCache<IMemory.MemoryContext> cache = exec_ctx.getMemoryContext();
+ if (!cache.validate(this)) return;
+ if (cache.getError() != null) {
+ error(cache.getError());
+ }
+ else {
+ IMemory.MemoryContext mem = cache.getData();
+ if (mem == null) {
+ error("Context does not provide memory access");
+ }
+ else {
+ done(mem.getAddressableUnitSize());
+ }
+ }
+ }
+ }
+ }.getD();
}
@Override

Back to the top