From 4cc0b421397e32939b944beb9e436279607afbb0 Mon Sep 17 00:00:00 2001 From: Eugene Tarassov Date: Wed, 11 Feb 2015 20:25:34 -0800 Subject: TCF Core: new memory context properties: "AddressableUnitSize" and "DefaultWordSize" --- .../debug/ui/adapters/TCFNodePropertySource.java | 15 ++++++++++++- .../debug/ui/model/TCFMemoryBlockRetrieval.java | 26 ++++++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) (limited to 'plugins/org.eclipse.tcf.debug.ui') 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 mem_cache = exe_node.getMemoryContext(); TCFDataCache ctx_cache = exe_node.getRunContext(); TCFDataCache state_cache = exe_node.getState(); TCFDataCache 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 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 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(exec_ctx.getChannel()) { + @Override + public void run() { + if (exec_ctx.isDisposed()) { + error("Context is disposed"); + } + else { + TCFDataCache 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 -- cgit v1.2.3