Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreutarass2009-03-16 21:57:52 +0000
committereutarass2009-03-16 21:57:52 +0000
commitf6099d092b6050574f3fb9807419674fab102242 (patch)
treea9e7c685d85f3b560c2df398bdd46564cb5d6d21
parent11c5ba7fdcdb91430052109f84479b0c20b43e05 (diff)
downloadorg.eclipse.tcf-f6099d092b6050574f3fb9807419674fab102242.tar.gz
org.eclipse.tcf-f6099d092b6050574f3fb9807419674fab102242.tar.xz
org.eclipse.tcf-f6099d092b6050574f3fb9807419674fab102242.zip
Bug 264723: API extension to TCF Registers and Memory services
-rw-r--r--docs/TCF Service - Memory.html182
-rw-r--r--docs/TCF Service - Registers.html250
-rw-r--r--plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java2
-rw-r--r--plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRegisters.java20
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/MemoryProxy.java23
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/RegistersProxy.java50
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IMemory.java80
-rw-r--r--plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IRegisters.java115
8 files changed, 640 insertions, 82 deletions
diff --git a/docs/TCF Service - Memory.html b/docs/TCF Service - Memory.html
index 0e93e36b0..ffc87099c 100644
--- a/docs/TCF Service - Memory.html
+++ b/docs/TCF Service - Memory.html
@@ -110,11 +110,65 @@ Service sends contextChanged event to notify changes in context data.</p>
<li><code><b><font face="Courier New" size=2 color=#333399>"ParentID" : <i>&lt;string&gt;</i></font></b></code>
- ID of a parent context.
+ <li><code><b><font face="Courier New" size=2 color=#333399>"ProcessID" : <i>&lt;string&gt;</i></font></b></code>
+ - process ID.
+
<li><code><b><font face="Courier New" size=2 color=#333399>"BigEndian" : <i>&lt;boolean&gt;</i></font></b></code>
- true if memory is big-endian.
<li><code><b><font face="Courier New" size=2 color=#333399>"AddressSize" : <i>&lt;int&gt;</i></font></b></code>
- size of memory address in bytes.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"Name" : <i>&lt;int&gt;</i></font></b></code>
+ - name of the context, can be used for UI purposes.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"StartBound" : <i>&lt;int&gt;</i></font></b></code>
+ - lowest address (inclusive) which is valid for the context.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"EndBound" : <i>&lt;int&gt;</i></font></b></code>
+ - highest address (inclusive) which is valid for the context.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"AccessTypes" : <i>&lt;array of strings&gt;</i></font></b></code>
+ - Defines the access types allowed for this context.
+ <p>Target system can support multiple different memory access types, like instruction and data access.
+ Different access types can use different logic for address translation and memory mapping, so they can
+ end up accessing different data bits, even if address is the same.
+ Each distinct access type should be represented by separate memory context.
+ A memory context can represent multiple access types if they are equivalent - all access same memory bits.
+ Same data bits can be exposed through multiple memory contexts.</p>
+
+ <p>Predefined access types are:</p>
+ <ul>
+ <li><code><b><font face="Courier New" size=2 color=#333399>"instruction"</font></b></code>
+ - Context represent instructions fetch access.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"data"</font></b></code>
+ - Context represents data access.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"io"</font></b></code>
+ - Context represents IO peripherals.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"user"</font></b></code>
+ - Context represents a user (e.g. application running in Linux) view to memory.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"supervisor"</font></b></code>
+ - Context represents a supervisor (e.g. Linux kernel) view to memory.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"hypervisor"</font></b></code>
+ - Context represents a hypervisor view to memory.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"virtual"</font></b></code>
+ - Context uses virtual addresses.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"physical"</font></b></code>
+ - Context uses physical addresses.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"cache"</font></b></code>
+ - Context is a cache.
+
+ <li><code><b><font face="Courier New" size=2 color=#333399>"tlb"</font></b></code>
+ - Context is a TLB memory.
+ </ul>
</ul>
<h3><a name='CmdGetChildren'>Get Children</a></h3>
@@ -274,6 +328,41 @@ E &bull; Memory &bull; memoryChanged &bull; <i>&lt;string: context ID&gt;</i> &b
<font color=#7F0055>static final</font> String NAME = "Memory";
<font color=#3F5FBF>/**
+ * Context property names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ PROP_ID = "ID", <font color=#3F5FBF>/** String, ID of the context, same as getContext command argument */</font>
+ PROP_PARENT_ID = "ParentID", <font color=#3F5FBF>/** String, ID of a parent context */</font>
+ PROP_PROCESS_ID = "ProcessID", <font color=#3F5FBF>/** String, process ID, see Processes service */</font>
+ PROP_BIG_ENDIAN = "BigEndian", <font color=#3F5FBF>/** Boolean, true if memory is big-endian */</font>
+ PROP_ADDRESS_SIZE = "AddressSize", <font color=#3F5FBF>/** Number, size of memory address in bytes */</font>
+ PROP_NAME = "Name", <font color=#3F5FBF>/** String, name of the context, can be used for UI purposes */</font>
+ PROP_START_BOUND = "StartBound", <font color=#3F5FBF>/** Number, lowest address (inclusive) which is valid for the context */</font>
+ PROP_END_BOUND = "EndBound", <font color=#3F5FBF>/** Number, highest address (inclusive) which is valid for the context */</font>
+ PROP_ACCESS_TYPES = "AccessTypes"; <font color=#3F5FBF>/** Array of String, the access types allowed for this context */</font>
+
+ <font color=#3F5FBF>/**
+ * Values of "AccessTypes".
+ * Target system can support multiple different memory access types, like instruction and data access.
+ * Different access types can use different logic for address translation and memory mapping, so they can
+ * end up accessing different data bits, even if address is the same.
+ * Each distinct access type should be represented by separate memory context.
+ * A memory context can represent multiple access types if they are equivalent - all access same memory bits.
+ * Same data bits can be exposed through multiple memory contexts.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ ACCESS_INSTRUCTION = "instruction", <font color=#3F5FBF>/** Context represent instructions fetch access */</font>
+ ACCESS_DATA = "data", <font color=#3F5FBF>/** Context represents data access */</font>
+ ACCESS_IO = "io", <font color=#3F5FBF>/** Context represents IO peripherals */</font>
+ ACCESS_USER = "user", <font color=#3F5FBF>/** Context represents a user (e.g. application running in Linux) view to memory */</font>
+ ACCESS_SUPERVISOR = "supervisor", <font color=#3F5FBF>/** Context represents a supervisor (e.g. Linux kernel) view to memory */</font>
+ ACCESS_HYPERVISOR = "hypervisor", <font color=#3F5FBF>/** Context represents a hypervisor view to memory */</font>
+ ACCESS_VIRTUAL = "virtual", <font color=#3F5FBF>/** Context uses virtual addresses */</font>
+ ACCESS_PHYSICAL = "physical", <font color=#3F5FBF>/** Context uses physical addresses */</font>
+ ACCESS_CACHE = "cache", <font color=#3F5FBF>/** Context is a cache */</font>
+ ACCESS_TLB = "tlb"; <font color=#3F5FBF>/** Context is a TLB memory */</font>
+
+ <font color=#3F5FBF>/**
* Retrieve context info for given context ID.
*
* <font color=#7F9FBF>@param</font> id &ndash; context ID.
@@ -339,22 +428,65 @@ E &bull; Memory &bull; memoryChanged &bull; <i>&lt;string: context ID&gt;</i> &b
<font color=#7F0055>interface</font> MemoryContext {
<font color=#3F5FBF>/**
- * Retrieve context ID.
- * Same as getProperties().get("id")
+ * Get context ID.
+ * <font color=#7F9FBF>@return</font> context ID.
*/</font>
String getID();
-
+
<font color=#3F5FBF>/**
- * Return true if the context has children.
- * Same as getProperties().get("has_children")
- * Children can be retrieved by getContexts call.
+ * Get parent context ID.
+ * <font color=#7F9FBF>@return</font> parent ID.
*/</font>
- <font color=#7F0055>boolean</font> hasChildren();
-
+ String getParentID();
+
+ <font color=#3F5FBF>/**
+ * Get process ID, if applicable.
+ * <font color=#7F9FBF>@return</font> process ID.
+ */</font>
+ String getProcessID();
+
+ <font color=#3F5FBF>/**
+ * Get memory endianess.
+ * <font color=#7F9FBF>@return</font> true if memory id big-endian.
+ */</font>
+ boolean isBigEndian();
+
+ <font color=#3F5FBF>/**
+ * Get memory address size.
+ * <font color=#7F9FBF>@return</font> number of bytes used to store memory address value.
+ */</font>
+ int getAddressSize();
+
+ <font color=#3F5FBF>/**
+ * Get memory context name.
+ * The name can be used for UI purposes.
+ * <font color=#7F9FBF>@return</font> context name.
+ */</font>
+ String getName();
+
+ <font color=#3F5FBF>/**
+ * Get lowest address (inclusive) which is valid for the context.
+ * <font color=#7F9FBF>@return</font> lowest address.
+ */</font>
+ Number getStartBound();
+
+ <font color=#3F5FBF>/**
+ * Get highest address (inclusive) which is valid for the context.
+ * <font color=#7F9FBF>@return</font> highest address.
+ */</font>
+ Number getEndBound();
+
+ <font color=#3F5FBF>/**
+ * Get the access types allowed for this context.
+ * <font color=#7F9FBF>@return</font> collection of access type names.
+ */</font>
+ Collection&lt;String> getAccessTypes();
+
<font color=#3F5FBF>/**
- * Retrieve context properties.
+ * Get context properties.
+ * <font color=#7F9FBF>@return</font> all available context properties.
*/</font>
- Map&lt;String,Object&gt; getProperties();
+ Map&lt;String,Object> getProperties();
<font color=#3F5FBF>/**
* Set target memory.
@@ -375,15 +507,15 @@ E &bull; Memory &bull; memoryChanged &bull; <i>&lt;string: context ID&gt;</i> &b
*/</font>
<font color=#7F0055>void</font> fill(long addr, <font color=#7F0055>int</font> word_size, byte[] value,
<font color=#7F0055>int</font> size, <font color=#7F0055>int</font> mode, DoneMemory done);
-
- <font color=#3F5FBF>/**
- * Client callback interface for set(), get() and fill().
- */</font>
- <font color=#7F0055>interface</font> DoneMemory {
- <font color=#7F0055>void</font> doneMemory(MemoryError error);
- }
}
+ <font color=#3F5FBF>/**
+ * Client callback interface for set(), get() and fill().
+ */</font>
+ <font color=#7F0055>interface</font> DoneMemory {
+ <font color=#7F0055>void</font> doneMemory(MemoryError error);
+ }
+
<font color=#7F0055>class</font> MemoryError <font color=#7F0055>extends</font> Exception {
}
@@ -419,8 +551,22 @@ E &bull; Memory &bull; memoryChanged &bull; <i>&lt;string: context ID&gt;</i> &b
}
+ <font color=#3F5FBF>/**
+ * Add memory service event listener.
+ * <font color=#7F9FBF>@param</font> listener - event listener implementation.
+ */</font>
<font color=#7F0055>void</font> addListener(MemoryListener listener);
-
+
+ <font color=#3F5FBF>/**
+ * Remove memory service event listener.
+ * <font color=#7F9FBF>@param</font> listener - event listener implementation.
+ */</font>
+ <font color=#7F0055>void</font> removeListener(MemoryListener listener);
+
+ <font color=#3F5FBF>/**
+ * Memory event listener is notified when memory context hierarchy
+ * changes, and when memory is modified by memory service commands.
+ */</font>
<font color=#7F0055>interface</font> MemoryListener {
<font color=#3F5FBF>/**
diff --git a/docs/TCF Service - Registers.html b/docs/TCF Service - Registers.html
index b47f490c7..1ebc84436 100644
--- a/docs/TCF Service - Registers.html
+++ b/docs/TCF Service - Registers.html
@@ -17,6 +17,7 @@
<li><a href='#CmdGetRegister'>Get Register</a>
<li><a href='#CmdSetMultiple'>Set Multiple Registers</a>
<li><a href='#CmdGetMultiple'>Get Multiple Registers</a>
+ <li><a href='#CmdSearch'>Search for Registers</a>
</ul>
<li><a href='#Events'>Events</a>
<li><a href='#API'>API</a>
@@ -35,7 +36,7 @@ multiple locations. This allows:
<ol>
<li> to get/set multiple register contexts in one command
<li> to specify offset and size for get/set on large register groups
- <li> to get/set trunkated register values, e.g. only the low 32 bits of a 64-bit register
+ <li> to get/set truncated register values, e.g. only the low 32 bits of a 64-bit register
</ol>
<h2><a name='Cmds'>Commands</a></h2>
@@ -89,7 +90,7 @@ Service sends contextChanged event to notify changes in context data.</p>
- context description.
<li><code><b><font face="Courier New" size=2 color=#333399>"Size" : <i>&lt;int&gt;</i></font></b></code>
- - context size in bytes. Byte arrays in get/set commandss should be same size.
+ - context size in bytes. Byte arrays in get/set commands should be same size.
Hardware register can be smaller then this size, for example in case
when register size is not an even number of bytes. In such case implementation
should add/remove padding that consists of necessary number of zero bits.
@@ -117,6 +118,7 @@ Service sends contextChanged event to notify changes in context data.</p>
<li><code><b><font face="Courier New" size=2 color=#333399>"BigEndian" : <i>&lt;boolean&gt;</i></font></b></code>
- true if big endian, which means decreasing numeric significance with increasing bit number.
+ If absent default if false, which implies little endianess. The endianess is used to encode and decode values of get, getm, set and setm commands.
<li><code><b><font face="Courier New" size=2 color=#333399>"LeftToRight" : <i>&lt;boolean&gt;</i></font></b></code>
- true if the lowest numbered bit (i.e. bit #0 or bit #1, depending on "FirstBit" value) should be shown to user as the left-most bit.
@@ -129,7 +131,61 @@ Service sends contextChanged event to notify changes in context data.</p>
<li><code><b><font face="Courier New" size=2 color=#333399>"Values" : <i>&lt;array of named values&gt;</i></font></b></code>
- predefined names (mnemonics) for some of context values.
+ <pre><b><font face="Courier New" size=2 color=#333399>
+ <i>&lt;array of named values&gt;</i>
+ &rArr; null
+ &rArr; [ ]
+ &rArr; [ <i>&lt;named values list&gt;</i> ]
+
+ <i>&lt;named values list&gt;</i>
+ &rArr; <i>&lt;object: named value properties&gt;</i>
+ &rArr; <i>&lt;named values list&gt;</i> , <i>&lt;object: named value properties&gt;</i>
+ </font></b></pre>
+ Named value properties are:
+ <ul>
+ <li><code><b><font face="Courier New" size="2" color="#333399">"Name"</font></b></code>
+ - Name (menemonic) of the value.
+ <li><code><b><font face="Courier New" size="2" color="#333399">"Value"</font></b></code>
+ - BASE64 encoded binary bits of the value.
+ <li><code><b><font face="Courier New" size="2" color="#333399">"Description"</font></b></code>
+ - Short, human readable description of the value.
+ </ul>
+ <p>
+
+ <li><code><b><font face="Courier New" size="2" color="#333399">"MemoryAddress" : <i>&lt;int&gt;</i></font></b></code>
+ - The address of a memory mapped register. If MemoryContext is provided, the address is referring into that context.
+
+ <li><code><b><font face="Courier New" size="2" color="#333399">"MemoryContext" : <i>&lt;string&gt;</i></font></b></code>
+ - The context ID of a memory context in which a memory mapped register is located. Used together with MemoryAddress to inform where in memory memory mapped registers are located.
+ If absent and MemoryAddress is defined, the context ID of this context is used as default.
+
+ <li><code><b><font face="Courier New" size="2" color="#333399">"CanSearch" : <i>&lt;array of strings&gt;</i></font></b></code>
+ - A list of attribute names which can be searched for starting on this context.
+ If absent the context does not support search.
+
+ <li><code><b><font face="Courier New" size="2" color="#333399">"Role" : <i>&lt;string&gt;</i></font></b></code>
+ - The role the register plays in a program execution.
+
+ <p>Predefined register role strings are:</p>
+ <ul>
+ <li><code><b><font face="Courier New" size="2" color="#333399">"PC"</font></b></code>
+ - Program counter. Defines instruction to execute next.
+
+ <li><code><b><font face="Courier New" size="2" color="#333399">"SP"</font></b></code>
+ - Register defining the current stack pointer location.
+
+ <li><code><b><font face="Courier New" size="2" color="#333399">"FP"</font></b></code>
+ - Register defining the current frame pointer location.
+ <li><code><b><font face="Courier New" size="2" color="#333399">"RET"</font></b></code>
+ - Register used to store the return address for calls.
+
+ <li><code><b><font face="Courier New" size="2" color="#333399">"CORE"</font></b></code>
+ - Indicates register or register groups which belong to the core state.
+ Commonly set for general purpose registers,
+ condition code and other registers which are of special
+ interest for determining the state.
+ </ul>
</ul>
<h3><a name='CmdGetChildren'>Get Children</a></h3>
@@ -255,12 +311,75 @@ R &bull; <i>&lt;token&gt;</i> &bull; <i>&lt;error report&gt;</i> &bull; <i>&lt;s
<p>Error report provides integer error code and a short, human readable explanation
of error. Value is BASE64 encoded byte array of binary data. Byte array size should match the sum of location sizes.</p>
+<h3><a name='CmdSearch'>Search for Registers</a></h3>
+
+<pre><b><font face="Courier New" size="2" color="#333399">
+C &bull; &lt;token&gt; &bull; Registers &bull; search &bull; <i>&lt;string: start context ID&gt; &bull; &lt;object:filter properties&gt;</i> &bull;
+</font></b></pre>
+
+<p>Search returns a path to each context with properties matching the filter. A path consists of a list of
+ context ids starting with a direct child of the start context up to the found context.
+ Search is only supported for properties listed in the CanSearch property.
+
+<p>Predefined filter object properties are:</p>
+<ul>
+ <li><code><b><font face="Courier New" size="2" color="#333399">"Name" : <i>&lt;string&gt;</i></font></b></code>
+ - The name of the property this filter applies to. Must be one of the names listed in the CanSearch property.
+ </li>
+ <li><code><b><font face="Courier New" size="2" color="#333399">"EqualValue" : <i>&lt;string&gt;</i></font></b></code>
+ - The value which is searched for.
+ </li>
+</ul>
+</p>
+
+<p>Result message:</p>
+
+<pre><b><font face="Courier New" size="2" color="#333399">
+R &bull; <i>&lt;token&gt;</i> &bull; <i>&lt;error report&gt;</i> &bull; <i>&lt;array of context Paths&gt;</i> &bull;
+
+<i>&lt;array of context Paths&gt;</i>
+ &rArr; null
+ &rArr; [ ]
+ &rArr; [ <i>&lt;context Path list&gt;</i> ]
+
+<i>&lt;context Path list&gt;</i>
+ &rArr; <i>&lt;array of context IDs&gt;</i>
+ &rArr; <i>&lt;context Path list&gt;</i> , <i>&lt;array of context IDs&gt;</i>
+
+</font></b></pre>
+
+<p>Error report provides integer error code and a short, human readable explanation of error.
+In the result, each matching context is provided with the path of parents starting with the direct
+children of the starting node up to the matching node.
+Multiple found entries are returned as an array of those paths.
+</p>
+Example Assume the following context hierarchy:
+
+<pre><b><font face="Courier New" size="2">
+{"Name" : "Core", "ID":"ID_C"}
+ {"Name" : "Group0", "ID":"ID_G0", "Role":"CORE"}
+ {"Name" : "PC", "ID":"ID_PC", "Role":"PC"}
+ {"Name" : "SP", "ID":"ID_SP", "Role":"SP"}
+ {"Name" : "Group1", "ID":"ID_G1"}
+ {"Name" : "R0", "ID":"ID_R0"}
+</font></b></pre>
+
+With this setup, the following commands and responses could take place:
+
+<pre><b><font face="Courier New" size="2">
+C &bull; "1234" &bull; Registers &bull; search &bull; "ID_C" &bull; {"Name":"Name", "EqualValue":"PC"} &bull;
+R &bull; "1234" &bull; [["ID_G0", "ID_PC"]] &bull;
+
+C &bull; "1235" &bull; Registers &bull; search &bull; "ID_C" &bull; {"Name":"Role", "EqualValue":"CORE"} &bull;
+R &bull; "1235" &bull; [["ID_G0"]] &bull;
+</font></b></pre>
+
<h2><a name='Events'>Events</a></h2>
<p>Registers service broadcasts notification events when registers contexts are changed, and when
a register content is altered by "set" commands.</p>
-<pre><b><font face="Courier New" size=2 color=#333399>
+<pre><b><font face="Courier New" size="2" color="#333399">
E &bull; Registers &bull; contextChanged &bull;
E &bull; Registers &bull; registerChanged &bull; <i>&lt;string: context ID&gt;</i> &bull;
</font></b></pre>
@@ -279,25 +398,47 @@ E &bull; Registers &bull; registerChanged &bull; <i>&lt;string: context ID&gt;</
* Context property names.
*/</font>
<font color=#7F0055>static final</font> String
- PROP_ID = "ID",
- PROP_PARENT_ID = "ParentID",
- PROP_PROCESS_ID = "ProcessID",
- PROP_NAME = "Name",
- PROP_DESCRIPTION = "Description",
- PROP_SIZE = "Size",
- PROP_READBLE = "Readable",
- PROP_READ_ONCE = "ReadOnce",
- PROP_WRITEABLE = "Writeable",
- PROP_WRITE_ONCE = "WriteOnce",
- PROP_SIDE_EFFECTS = "SideEffects",
- PROP_VOLATILE = "Volatile",
- PROP_FLOAT = "Float",
- PROP_BIG_ENDIAN = "BigEndian",
- PROP_LEFT_TO_RIGHT = "LeftToRight",
- PROP_FIST_BIT = "FirstBit",
- PROP_BITS = "Bits",
- PROP_VALUES = "Values";
-
+ PROP_ID = "ID", <font color=#3F5FBF>/** String, ID of the context */</font>
+ PROP_PARENT_ID = "ParentID", <font color=#3F5FBF>/** String, ID of a parent context */</font>
+ PROP_PROCESS_ID = "ProcessID", <font color=#3F5FBF>/** String, process ID */</font>
+ PROP_NAME = "Name", <font color=#3F5FBF>/** String, context name */</font>
+ PROP_DESCRIPTION = "Description", <font color=#3F5FBF>/** String, context description */</font>
+ PROP_SIZE = "Size", <font color=#3F5FBF>/** Number, context size in bytes. Byte arrays in get/set commands should be same size */</font>
+ PROP_READBLE = "Readable", <font color=#3F5FBF>/** Boolean, true if context value can be read */</font>
+ PROP_READ_ONCE = "ReadOnce", <font color=#3F5FBF>/** Boolean, true if reading the context (register) destroys its current value */</font>
+ PROP_WRITEABLE = "Writeable", <font color=#3F5FBF>/** Boolean, true if context value can be written */</font>
+ PROP_WRITE_ONCE = "WriteOnce", <font color=#3F5FBF>/** Boolean, true if register value can not be overwritten - every write counts */</font>
+ PROP_SIDE_EFFECTS = "SideEffects", <font color=#3F5FBF>/** Boolean, true if writing the context can change values of other registers */</font>
+ PROP_VOLATILE = "Volatile", <font color=#3F5FBF>/** Boolean, true if the register value can change even when target is stopped */</font>
+ PROP_FLOAT = "Float", <font color=#3F5FBF>/** Boolean, true if the register value is a floating-point value */</font>
+ PROP_BIG_ENDIAN = "BigEndian", <font color=#3F5FBF>/** Boolean, true if big endian */</font>
+ PROP_LEFT_TO_RIGHT = "LeftToRight", <font color=#3F5FBF>/** Boolean, true if the lowest numbered bit should be shown to user as the left-most bit */</font>
+ PROP_FIST_BIT = "FirstBit", <font color=#3F5FBF>/** Number, bit numbering base (0 or 1) to use when showing bits to user */</font>
+ PROP_BITS = "Bits", <font color=#3F5FBF>/** Number, if context is a bit field, contains the field bit numbers in the parent context */</font>
+ PROP_VALUES = "Values", <font color=#3F5FBF>/** Array of Map, predefined names (mnemonics) for some of context values */</font>
+ PROP_MEMORY_ADDRESS = "MemoryAddress", <font color=#3F5FBF>/** Number, the address of a memory mapped register */</font>
+ PROP_MEMORY_CONTEXT = "MemoryContext", <font color=#3F5FBF>/** String, the context ID of a memory context in which a memory mapped register is located */</font>
+ PROP_CAN_SEARCH = "CanSearch", <font color=#3F5FBF>/** Array of String, a list of attribute names which can be searched for starting on this context */</font>
+ PROP_ROLE = "Role"; <font color=#3F5FBF>/** String, the role the register plays in a program execution */</font>
+
+ <font color=#3F5FBF>/**
+ * Role property names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ ROLE_PC = "PC", <font color=#3F5FBF>/** Program counter. Defines instruction to execute next */</font>
+ ROLE_SP = "SP", <font color=#3F5FBF>/** Register defining the current stack pointer location */</font>
+ ROLE_FP = "FP", <font color=#3F5FBF>/** Register defining the current frame pointer location */</font>
+ ROLE_RET = "RET", <font color=#3F5FBF>/** Register used to store the return address for calls */</font>
+ ROLE_CORE = "CORE"; <font color=#3F5FBF>/** Indicates register or register groups which belong to the core state */</font>
+
+ <font color=#3F5FBF>/**
+ * Filter property names.
+ */</font>
+ <font color=#7F0055>static final</font> String
+ SEARCH_NAME = "Name", <font color=#3F5FBF>/** The name of the property this filter applies too */</font>
+ SEARCH_EQUAL_VALUE = "EqualValue"; <font color=#3F5FBF>/** The value which is searched for */</font>
+
+
<font color=#3F5FBF>/**
* Retrieve context info for given context ID.
*
@@ -464,10 +605,34 @@ E &bull; Registers &bull; registerChanged &bull; <i>&lt;string: context ID&gt;</
NamedValue[] getNamedValues();
<font color=#3F5FBF>/**
+ * Get the address of a memory mapped register.
+ * <font color=#7F9FBF>@return</font> address.
+ */</font>
+ Number getMemoryAddress();
+
+ <font color=#3F5FBF>/**
+ * Get the context ID of a memory context in which a memory mapped register is located.
+ * <font color=#7F9FBF>@return</font> memory context ID.
+ */</font>
+ String getMemoryContext();
+
+ <font color=#3F5FBF>/**
+ * Get a list of property names which can be searched for starting on this context
+ * <font color=#7F9FBF>@return</font> collection of property names.
+ */</font>
+ Collection<String> canSearch();
+
+ <font color=#3F5FBF>/**
+ * Get the role the register plays in a program execution.
+ * <font color=#7F9FBF>@return</font> role name.
+ */</font>
+ String getRole();
+
+ <font color=#3F5FBF>/**
* Get complete map of context properties.
- * <font color=#7F9FBF>@return</font> map of context properties.
+ * <font color=#7F9FBF>@return</font> map of all available context properties.
*/</font>
- Map&lt;String,Object&gt; getProperties();
+ Map<String,Object> getProperties();
<font color=#3F5FBF>/**
* Read value of the context.
@@ -483,8 +648,17 @@ E &bull; Registers &bull; registerChanged &bull; <i>&lt;string: context ID&gt;</
* <font color=#7F9FBF>@return</font> - pending command handle.
*/</font>
IToken set(byte[] value, DoneSet done);
+
+ <font color=#3F5FBF>/**
+ * Search register contexts that passes given search filter.
+ * Search is only supported for properties listed in the "CanSearch" property.
+ * <font color=#7F9FBF>@param</font> filter - properties bag that defines search filter.
+ * <font color=#7F9FBF>@param</font> done - call back object.
+ * <font color=#7F9FBF>@return</font> - pending command handle.
+ */</font>
+ IToken search(Map&lt;String,Object&gt; filter, DoneSearch done);
}
-
+
<font color=#3F5FBF>/**
* A register context can have predefined names (mnemonics) for some its values.
* NamedValue objects represent such values.
@@ -550,6 +724,12 @@ E &bull; Registers &bull; registerChanged &bull; <i>&lt;string: context ID&gt;</
* 'get' command call back interface.
*/</font>
<font color=#7F0055>interface</font> DoneGet {
+ <font color=#3F5FBF>/**
+ * Called when value retrieval is done.
+ * <font color=#7F9FBF>@param</font> token - command handle
+ * <font color=#7F9FBF>@param</font> error - error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> value - context value as array of bytes.
+ */</font>
<font color=#7F0055>void</font> doneGet(IToken token, Exception error, byte[] value);
}
@@ -557,10 +737,28 @@ E &bull; Registers &bull; registerChanged &bull; <i>&lt;string: context ID&gt;</
* 'set' command call back interface.
*/</font>
<font color=#7F0055>interface</font> DoneSet {
+ <font color=#3F5FBF>/**
+ * Called when value setting is done.
+ * <font color=#7F9FBF>@param</font> token - command handle.
+ * <font color=#7F9FBF>@param</font> error - error description if operation failed, null if succeeded.
+ */</font>
<font color=#7F0055>void</font> doneSet(IToken token, Exception error);
}
<font color=#3F5FBF>/**
+ * 'search' command call back interface.
+ */</font>
+ <font color=#7F0055>interface</font> DoneSearch {
+ <font color=#3F5FBF>/**
+ * Called when context search is done.
+ * <font color=#7F9FBF>@param</font> token - command handle.
+ * <font color=#7F9FBF>@param</font> error - error description if operation failed, null if succeeded.
+ * <font color=#7F9FBF>@param</font> paths - array of paths to each context with properties matching the filter
+ */</font>
+ <font color=#7F0055>void</font> doneSearch(IToken token, String[][] paths);
+ }
+
+ <font color=#3F5FBF>/**
* Add registers service event listener.
* <font color=#7F9FBF>@param</font> listener - event listener implementation.
*/</font>
@@ -593,6 +791,8 @@ E &bull; Registers &bull; registerChanged &bull; <i>&lt;string: context ID&gt;</
* corresponding cached registers data.
* Not every change is notified - it is not possible,
* only those, which are not caused by normal execution of the debuggee.
+ * At least, changes caused by "set" command should be notified.
+ * <font color=#7F9FBF>@param</font> id - register context ID.
*/</font>
<font color=#7F0055>void</font> registerChanged(String context_id);
}
diff --git a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
index 4c5a12c26..19b91d17d 100644
--- a/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
+++ b/plugins/org.eclipse.tm.tcf.debug/src/org/eclipse/tm/internal/tcf/debug/tests/TestRCBP1.java
@@ -663,7 +663,7 @@ class TestRCBP1 implements ITCFTest,
exit(new Exception("Bad memory context data: invalid ID"));
}
Object pid = context.getProperties().get(IRunControl.PROP_PROCESS_ID);
- if (pid != null && !pid.equals(mem_ctx.getProperties().get(IMemory.PROP_PROCESS_ID))) {
+ if (pid != null && !pid.equals(mem_ctx.getProcessID())) {
exit(new Exception("Bad memory context data: invalid ProcessID"));
}
final boolean big_endian = mem_ctx.isBigEndian();
diff --git a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRegisters.java b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRegisters.java
index 7987075cc..a6c2a2616 100644
--- a/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRegisters.java
+++ b/plugins/org.eclipse.tm.tcf.dsf/src/org/eclipse/tm/internal/tcf/dsf/services/TCFDSFRegisters.java
@@ -13,6 +13,7 @@ package org.eclipse.tm.internal.tcf.dsf.services;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
@@ -37,6 +38,7 @@ import org.eclipse.tm.internal.tcf.dsf.Activator;
import org.eclipse.tm.tcf.protocol.IChannel;
import org.eclipse.tm.tcf.protocol.IToken;
import org.eclipse.tm.tcf.services.IRegisters.DoneGet;
+import org.eclipse.tm.tcf.services.IRegisters.DoneSearch;
import org.eclipse.tm.tcf.services.IRegisters.DoneSet;
import org.eclipse.tm.tcf.services.IRegisters.NamedValue;
import org.eclipse.tm.tcf.util.TCFDataCache;
@@ -157,12 +159,30 @@ public class TCFDSFRegisters extends AbstractDsfService implements org.eclipse.d
public boolean isWriteable() {
return false;
}
+ public Collection<String> canSearch() {
+ return null;
+ }
+ public Number getMemoryAddress() {
+ return null;
+ }
+ public String getMemoryContext() {
+ return null;
+ }
+ public String getProcessID() {
+ return null;
+ }
+ public String getRole() {
+ return null;
+ }
public IToken get(DoneGet done) {
throw new Error();
}
public IToken set(byte[] value, DoneSet done) {
throw new Error();
}
+ public IToken search(Map<String, Object> filter, DoneSearch done) {
+ throw new Error();
+ }
};
}
}
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/MemoryProxy.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/MemoryProxy.java
index b2835df6e..a82649110 100644
--- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/MemoryProxy.java
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/MemoryProxy.java
@@ -162,10 +162,8 @@ public class MemoryProxy implements IMemory {
return n.intValue();
}
- public int getProcessID() {
- Number n = (Number)props.get(PROP_PROCESS_ID);
- if (n == null) return 0;
- return n.intValue();
+ public String getProcessID() {
+ return (String)props.get(PROP_PROCESS_ID);
}
public boolean isBigEndian() {
@@ -174,6 +172,23 @@ public class MemoryProxy implements IMemory {
return n.booleanValue();
}
+ @SuppressWarnings("unchecked")
+ public Collection<String> getAccessTypes() {
+ return (Collection<String>)props.get(PROP_ACCESS_TYPES);
+ }
+
+ public Number getEndBound() {
+ return (Number)props.get(PROP_END_BOUND);
+ }
+
+ public String getName() {
+ return (String)props.get(PROP_NAME);
+ }
+
+ public Number getStartBound() {
+ return (Number)props.get(PROP_START_BOUND);
+ }
+
public Map<String, Object> getProperties() {
return props;
}
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/RegistersProxy.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/RegistersProxy.java
index 71486138a..bdeb91af3 100644
--- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/RegistersProxy.java
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/internal/tcf/services/remote/RegistersProxy.java
@@ -131,6 +131,28 @@ public class RegistersProxy implements IRegisters {
return n.booleanValue();
}
+ @SuppressWarnings("unchecked")
+ public Collection<String> canSearch() {
+ return (Collection<String>)props.get(PROP_CAN_SEARCH);
+ }
+
+ public Number getMemoryAddress() {
+ return (Number)props.get(PROP_MEMORY_ADDRESS);
+ }
+
+ public String getMemoryContext() {
+ return (String)props.get(PROP_MEMORY_CONTEXT);
+ }
+
+ public String getProcessID() {
+ return (String)props.get(PROP_PROCESS_ID);
+ }
+
+ public String getRole() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
public IToken get(final DoneGet done) {
return new Command(channel, RegistersProxy.this, "get",
new Object[]{ getID() }) {
@@ -161,6 +183,22 @@ public class RegistersProxy implements IRegisters {
}
}.token;
}
+
+ public IToken search(Map<String,Object> filter, final DoneSearch done) {
+ return new Command(channel, RegistersProxy.this, "search",
+ new Object[]{ getID(), filter }) {
+ @Override
+ public void done(Exception error, Object[] args) {
+ String[][] paths = null;
+ if (error == null) {
+ assert args.length == 2;
+ error = toError(args[0]);
+ paths = toPathArray(args[1]);
+ }
+ done.doneSearch(token, error, paths);
+ }
+ }.token;
+ }
public String toString() {
return "[Registers Context " + props.toString() + "]";
@@ -284,6 +322,18 @@ public class RegistersProxy implements IRegisters {
return arr;
}
+ @SuppressWarnings("unchecked")
+ private String[][] toPathArray(Object o) {
+ if (o == null) return null;
+ Collection<Collection<String>> c = (Collection<Collection<String>>)o;
+ int i = 0;
+ String[][] r = new String[c.size()][];
+ for (Collection<String> p : c) {
+ r[i++] = (String[])p.toArray(new String[p.size()]);
+ }
+ return r;
+ }
+
private static class NamedValueInfo implements NamedValue {
private final String desc;
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IMemory.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IMemory.java
index 3304bc6b6..a77941d5c 100644
--- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IMemory.java
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IMemory.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.tm.tcf.services;
+import java.util.Collection;
import java.util.Map;
import org.eclipse.tm.tcf.protocol.IService;
@@ -27,11 +28,36 @@ public interface IMemory extends IService {
* Context property names.
*/
static final String
- PROP_ID = "ID",
- PROP_PARENT_ID = "ParentID",
- PROP_PROCESS_ID = "ProcessID",
- PROP_BIG_ENDIAN = "BigEndian",
- PROP_ADDRESS_SIZE = "AddressSize";
+ PROP_ID = "ID", /** String, ID of the context, same as getContext command argument */
+ PROP_PARENT_ID = "ParentID", /** String, ID of a parent context */
+ PROP_PROCESS_ID = "ProcessID", /** String, process ID, see Processes service */
+ PROP_BIG_ENDIAN = "BigEndian", /** Boolean, true if memory is big-endian */
+ PROP_ADDRESS_SIZE = "AddressSize", /** Number, size of memory address in bytes */
+ PROP_NAME = "Name", /** String, name of the context, can be used for UI purposes */
+ PROP_START_BOUND = "StartBound", /** Number, lowest address (inclusive) which is valid for the context */
+ PROP_END_BOUND = "EndBound", /** Number, highest address (inclusive) which is valid for the context */
+ PROP_ACCESS_TYPES = "AccessTypes"; /** Array of String, the access types allowed for this context */
+
+ /**
+ * Values of "AccessTypes".
+ * Target system can support multiple different memory access types, like instruction and data access.
+ * Different access types can use different logic for address translation and memory mapping, so they can
+ * end up accessing different data bits, even if address is the same.
+ * Each distinct access type should be represented by separate memory context.
+ * A memory context can represent multiple access types if they are equivalent - all access same memory bits.
+ * Same data bits can be exposed through multiple memory contexts.
+ */
+ static final String
+ ACCESS_INSTRUCTION = "instruction", /** Context represent instructions fetch access */
+ ACCESS_DATA = "data", /** Context represents data access */
+ ACCESS_IO = "io", /** Context represents IO peripherals */
+ ACCESS_USER = "user", /** Context represents a user (e.g. application running in Linux) view to memory */
+ ACCESS_SUPERVISOR = "supervisor", /** Context represents a supervisor (e.g. Linux kernel) view to memory */
+ ACCESS_HYPERVISOR = "hypervisor", /** Context represents a hypervisor view to memory */
+ ACCESS_VIRTUAL = "virtual", /** Context uses virtual addresses */
+ ACCESS_PHYSICAL = "physical", /** Context uses physical addresses */
+ ACCESS_CACHE = "cache", /** Context is a cache */
+ ACCESS_TLB = "tlb"; /** Context is a TLB memory */
/**
* Retrieve context info for given context ID.
@@ -101,37 +127,63 @@ public interface IMemory extends IService {
interface MemoryContext {
/**
- * Retrieve context ID.
- * Same as (String)getProperties().get(“ID”)
+ * Get context ID.
+ * @return context ID.
*/
String getID();
/**
- * Retrieve parent context ID.
- * Same as (String)getProperties().get(“ParentID”)
+ * Get parent context ID.
+ * @return parent ID.
*/
String getParentID();
/**
- * Retrieves process ID, if applicable.
+ * Get process ID, if applicable.
* @return process ID.
*/
- int getProcessID();
+ String getProcessID();
/**
- * Retrieve memory endianess.
+ * Get memory endianess.
* @return true if memory id big-endian.
*/
boolean isBigEndian();
/**
- * Retrieve memory address size.
+ * Get memory address size.
* @return number of bytes used to store memory address value.
*/
int getAddressSize();
+
+ /**
+ * Get memory context name.
+ * The name can be used for UI purposes.
+ * @return context name.
+ */
+ String getName();
+
+ /**
+ * Get lowest address (inclusive) which is valid for the context.
+ * @return lowest address.
+ */
+ Number getStartBound();
+
+ /**
+ * Get highest address (inclusive) which is valid for the context.
+ * @return highest address.
+ */
+ Number getEndBound();
+
+ /**
+ * Get the access types allowed for this context.
+ * @return collection of access type names.
+ */
+ Collection<String> getAccessTypes();
/**
- * Retrieve context properties.
+ * Get context properties.
+ * @return all available context properties.
*/
Map<String,Object> getProperties();
diff --git a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IRegisters.java b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IRegisters.java
index 064e63541..1e0abee4c 100644
--- a/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IRegisters.java
+++ b/plugins/org.eclipse.tm.tcf/src/org/eclipse/tm/tcf/services/IRegisters.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.tm.tcf.services;
+import java.util.Collection;
import java.util.Map;
import org.eclipse.tm.tcf.protocol.IService;
@@ -27,24 +28,45 @@ public interface IRegisters extends IService {
* Context property names.
*/
static final String
- PROP_ID = "ID",
- PROP_PARENT_ID = "ParentID",
- PROP_PROCESS_ID = "ProcessID",
- PROP_NAME = "Name",
- PROP_DESCRIPTION = "Description",
- PROP_SIZE = "Size",
- PROP_READBLE = "Readable",
- PROP_READ_ONCE = "ReadOnce",
- PROP_WRITEABLE = "Writeable",
- PROP_WRITE_ONCE = "WriteOnce",
- PROP_SIDE_EFFECTS = "SideEffects",
- PROP_VOLATILE = "Volatile",
- PROP_FLOAT = "Float",
- PROP_BIG_ENDIAN = "BigEndian",
- PROP_LEFT_TO_RIGHT = "LeftToRight",
- PROP_FIST_BIT = "FirstBit",
- PROP_BITS = "Bits",
- PROP_VALUES = "Values";
+ PROP_ID = "ID", /** String, ID of the context */
+ PROP_PARENT_ID = "ParentID", /** String, ID of a parent context */
+ PROP_PROCESS_ID = "ProcessID", /** String, process ID */
+ PROP_NAME = "Name", /** String, context name */
+ PROP_DESCRIPTION = "Description", /** String, context description */
+ PROP_SIZE = "Size", /** Number, context size in bytes. Byte arrays in get/set commands should be same size */
+ PROP_READBLE = "Readable", /** Boolean, true if context value can be read */
+ PROP_READ_ONCE = "ReadOnce", /** Boolean, true if reading the context (register) destroys its current value */
+ PROP_WRITEABLE = "Writeable", /** Boolean, true if context value can be written */
+ PROP_WRITE_ONCE = "WriteOnce", /** Boolean, true if register value can not be overwritten - every write counts */
+ PROP_SIDE_EFFECTS = "SideEffects", /** Boolean, true if writing the context can change values of other registers */
+ PROP_VOLATILE = "Volatile", /** Boolean, true if the register value can change even when target is stopped */
+ PROP_FLOAT = "Float", /** Boolean, true if the register value is a floating-point value */
+ PROP_BIG_ENDIAN = "BigEndian", /** Boolean, true if big endian */
+ PROP_LEFT_TO_RIGHT = "LeftToRight", /** Boolean, true if the lowest numbered bit should be shown to user as the left-most bit */
+ PROP_FIST_BIT = "FirstBit", /** Number, bit numbering base (0 or 1) to use when showing bits to user */
+ PROP_BITS = "Bits", /** Number, if context is a bit field, contains the field bit numbers in the parent context */
+ PROP_VALUES = "Values", /** Array of Map, predefined names (mnemonics) for some of context values */
+ PROP_MEMORY_ADDRESS = "MemoryAddress", /** Number, the address of a memory mapped register */
+ PROP_MEMORY_CONTEXT = "MemoryContext", /** String, the context ID of a memory context in which a memory mapped register is located */
+ PROP_CAN_SEARCH = "CanSearch", /** Array of String, a list of attribute names which can be searched for starting on this context */
+ PROP_ROLE = "Role"; /** String, the role the register plays in a program execution */
+
+ /**
+ * Values of context property "Role".
+ */
+ static final String
+ ROLE_PC = "PC", /** Program counter. Defines instruction to execute next */
+ ROLE_SP = "SP", /** Register defining the current stack pointer location */
+ ROLE_FP = "FP", /** Register defining the current frame pointer location */
+ ROLE_RET = "RET", /** Register used to store the return address for calls */
+ ROLE_CORE = "CORE"; /** Indicates register or register groups which belong to the core state */
+
+ /**
+ * Search filter properties.
+ */
+ static final String
+ SEARCH_NAME = "Name", /** The name of the property this filter applies too */
+ SEARCH_EQUAL_VALUE = "EqualValue"; /** The value which is searched for */
/**
* Retrieve context info for given context ID.
@@ -114,6 +136,12 @@ public interface IRegisters extends IService {
String getParentID();
/**
+ * Get process ID, if applicable.
+ * @return process ID.
+ */
+ String getProcessID();
+
+ /**
* Get context (register, register group, bit field) name.
* @return context name.
*/
@@ -181,6 +209,7 @@ public interface IRegisters extends IService {
/**
* Check endianess of the context.
* Big endian means decreasing numeric significance with increasing bit number.
+ * The endianess is used to encode and decode values of get, getm, set and setm commands.
* @return true if big endian.
*/
boolean isBigEndian();
@@ -214,8 +243,32 @@ public interface IRegisters extends IService {
NamedValue[] getNamedValues();
/**
+ * Get the address of a memory mapped register.
+ * @return address.
+ */
+ Number getMemoryAddress();
+
+ /**
+ * Get the context ID of a memory context in which a memory mapped register is located.
+ * @return memory context ID.
+ */
+ String getMemoryContext();
+
+ /**
+ * Get a list of property names which can be searched for starting on this context
+ * @return collection of property names.
+ */
+ Collection<String> canSearch();
+
+ /**
+ * Get the role the register plays in a program execution.
+ * @return role name.
+ */
+ String getRole();
+
+ /**
* Get complete map of context properties.
- * @return map of context properties.
+ * @return map of all available context properties.
*/
Map<String,Object> getProperties();
@@ -233,6 +286,15 @@ public interface IRegisters extends IService {
* @return - pending command handle.
*/
IToken set(byte[] value, DoneSet done);
+
+ /**
+ * Search register contexts that passes given search filter.
+ * Search is only supported for properties listed in the "CanSearch" property.
+ * @param filter - properties bag that defines search filter.
+ * @param done - call back object.
+ * @return - pending command handle.
+ */
+ IToken search(Map<String,Object> filter, DoneSearch done);
}
/**
@@ -315,11 +377,24 @@ public interface IRegisters extends IService {
interface DoneSet {
/**
* Called when value setting is done.
- * @param token - command handle
+ * @param token - command handle.
* @param error – error description if operation failed, null if succeeded.
*/
void doneSet(IToken token, Exception error);
}
+
+ /**
+ * 'search' command call back interface.
+ */
+ interface DoneSearch {
+ /**
+ * Called when context search is done.
+ * @param token - command handle.
+ * @param error – error description if operation failed, null if succeeded.
+ * @param paths - array of paths to each context with properties matching the filter
+ */
+ void doneSearch(IToken token, Exception error, String[][] paths);
+ }
/**
* Add registers service event listener.

Back to the top