| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html> |
| <head> |
| <title>Target Communication Framework Services - Memory</title> |
| </head> |
| |
| <body lang='EN-US'> |
| |
| <h1>Target Communication Framework Services - Memory</h1> |
| |
| <ul> |
| <li><a href='#VersionHistory'>Version History</a> |
| <li><a href='#Overview'>Overview</a> |
| <li><a href='#Cmds'>Commands</a> |
| <ul> |
| <li><a href='#CmdGetContext'>Get Context</a> |
| <li><a href='#CmdGetChildren'>Get Children</a> |
| <li><a href='#CmdSetMemory'>Set Memory</a> |
| <li><a href='#CmdGetMemory'>Get Memory</a> |
| <li><a href='#CmdFillMemory'>Fill Memory</a> |
| </ul> |
| <li><a href='#Events'>Events</a> |
| <li><a href='#API'>API</a> |
| </ul> |
| |
| <h1>Memory Service</h1> |
| |
| <h2><a name='VersionHistory'>Version History</a></h2> |
| |
| <table border=1 cellpadding=8> |
| <tr> |
| <th>Version |
| <th>Date |
| <th>Change |
| <tr> |
| <td>0.1 |
| <td>2008-01-10 |
| <td>Initial contribution |
| <tr> |
| <td>1.0 |
| <td>2008-05-06 |
| <td>Approved |
| <tr> |
| <td>1.1 |
| <td>2009-03-16 |
| <td>Added context properties |
| </table> |
| |
| <h2><a name='Overview'>Overview</a></h2> |
| |
| <p>The service provides basic operations to read/write memory on a target. Command |
| and event parameters are encoded as zero terminated <a href='TCF Specification.html#JSON'>JSON</a> strings.</p> |
| |
| <p>The service uses standard format for error reports, |
| see <a href='TCF Services.html#ErrorFormat'>Error Report Format</a>.</p> |
| |
| <p>A single memory access can succeed for some addresses and fail for others. In such |
| situation result message can contain partially valid data. Array of error addresses, |
| in addition to error report, describes data validity on per byte basis:</p> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| <i><array of error addresses></i> |
| ⇒ null |
| ⇒ [ <i><error address list></i> ] |
| |
| <i><error address list></i> |
| ⇒ <i><error address></i> |
| ⇒ <i><error address list></i> , <i><error address></i> |
| |
| <i><error address></i> |
| ⇒ { "addr" : <i><int: range starting address></i> , "size" : <i><int: range length in bytes></i> , "stat" : <i><int: status code></i> , "msg" : <i><object: error description></i> } |
| </font></b></pre> |
| |
| <p>If there is no entry in error addresses array for a data byte, then status of such |
| byte is defined by main error report.</p> |
| |
| <p>Status code is bitwise or of status flags:</p> |
| <dl> |
| <dt><code><b>BYTE_VALID = 0x00</b></code> <dd>no error for this byte |
| <dt><code><b>BYTE_UNKNOWN = 0x01</b></code> <dd>status is unknown |
| <dt><code><b>BYTE_INVALID = 0x02</b></code> <dd>byte value in invalid, error message describes the problem |
| <dt><code><b>BYTE_CANNOT_READ = 0x04</b></code> <dd>cannot read the byte |
| <dt><code><b>BYTE_CANNOT_WRITE = 0x08</b></code> <dd>cannot write the byte |
| </dl> |
| |
| <h2><a name='Cmds'>Commands</a></h2> |
| |
| <h3><a name='CmdGetContext'>Get Context</a></h3> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| C • <i><token></i> • Memory • getContext • <i><string: context ID></i> • |
| </font></b></pre> |
| |
| <p>The command retrieves context info for given context ID. A context corresponds to an |
| execution thread, process, address space, etc. Exact |
| meaning of a context depends on the target. Target agent should define contexts hierarchy |
| that is:</p> |
| |
| <ul type='disc'> |
| <li>Sufficient to resolve possible ambiguity of a memory address; |
| |
| <li>Adequately reflects target memory management strategy; |
| |
| <li>Intuitive to a user. |
| </ul> |
| |
| <p>For traditional OS, like UNIX, memory access context can be one of:</p> |
| |
| <ul type='disc'> |
| <li>Kernel address space; |
| |
| <li>A process. |
| </ul> |
| |
| <p>Reply:</p> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| R • <i><token></i> • <i><error report></i> • <i><context data></i> • |
| |
| <i><context data></i> |
| ⇒ null |
| ⇒ <i><object></i> |
| </font></b></pre> |
| |
| <p>Context data object should, at least, contain member |
| <b><font face="Courier New" size=2 color=#333399>"ID" : <i><string>.</i></font></b> |
| Context data is expected to be cached by clients. |
| Service sends contextChanged event to notify changes in context data.</p> |
| |
| <p>Predefined memory context properties are:</p> |
| <ul> |
| <li><code><b><font face="Courier New" size=2 color=#333399>"ID" : <i><string></i></font></b></code> |
| - ID of the context, same as getContext command argument. |
| |
| <li><code><b><font face="Courier New" size=2 color=#333399>"ParentID" : <i><string></i></font></b></code> |
| - ID of a parent context. |
| |
| <li><code><b><font face="Courier New" size=2 color=#333399>"ProcessID" : <i><string></i></font></b></code> |
| - process ID. |
| |
| <li><code><b><font face="Courier New" size=2 color=#333399>"BigEndian" : <i><boolean></i></font></b></code> |
| - true if memory is big-endian. |
| |
| <li><code><b><font face="Courier New" size=2 color=#333399>"AddressSize" : <i><int></i></font></b></code> |
| - size of memory address in bytes. |
| |
| <li><code><b><font face="Courier New" size=2 color=#333399>"Name" : <i><string></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><int></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><int></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><array of strings></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> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| C • <i><token></i> • Memory • getChildren • <i><string: parent context ID></i> • |
| </font></b></pre> |
| |
| <p>The command requests a list of contexts available for memory access commands.</p> |
| |
| <p>Parent context ID can be null – to retrieve top level of the hierarchy, can be one |
| of context IDs retrieved by previous getChildren commands, or it can be obtained from another service. |
| Contexts hierarchy can be simple plain list or it can form a tree. It is up to target agent developers to |
| choose layout that is most descriptive for a given target.</p> |
| |
| <p>Reply:</p> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| R • <i><token></i> • <i><error report></i> • <i><array of context IDs></i> •<i></i> |
| |
| <i><array of context IDs></i> |
| ⇒ null |
| ⇒ [ ] |
| ⇒ [ <i><context ID list></i> ] |
| |
| <i><context ID list></i> |
| ⇒ <i><string: context ID></i> |
| ⇒ <i><context ID list></i> , <i><string: context ID></i> |
| |
| </font></b></pre> |
| |
| <h3><a name='CmdSetMemory'>Set Memory</a></h3> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| C • <token> • Memory • set • |
| <i><string: context ID></i> • <i><int: address></i> • <i><int: word size></i> • |
| <i><int: byte count></i> • <i><int: mode></i> • <i><string: BASE64 encoded byte array></i> • |
| </font></b></pre> |
| |
| <p>Writes data bytes at given address in memory, "word size" bytes at a time. Address |
| should be aligned by "word size". Context ID must be one returned by getContexts. |
| Mode is logical OR of any combination of:</p> |
| |
| <ul type='disc'> |
| <li>0x1 – continue on error (like bus error or page fault) |
| |
| <li>0x2 – verify data after writing by reading back and compare |
| </ul> |
| |
| <p>Result message:</p> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| R • <i><token></i> • <i><error report></i> • <i><array of error addresses></i> • |
| </font></b></pre> |
| |
| <p>Error report provides integer error code and a short, human readable explanation |
| of error. Error addresses, when present, let client know which bytes of data failed |
| to be written into memory.</p> |
| |
| <h3><a name='CmdGetMemory'>Get Memory</a></h3> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| C • <token> • Memory • get • |
| <i><string: context ID></i> • <i><int: address></i> • <i><int: word size></i> • |
| <i><int: byte count></i> • <i><int: mode></i> • |
| </font></b></pre> |
| |
| <p>Reads data bytes at given address in memory, "word size" bytes at a time. Address |
| should be aligned by "word size". Context ID must be one returned by getContexts. |
| Mode is logical OR of any combination of:</p> |
| |
| <ul type='disc'> |
| <li>0x1 – continue on error (like bus error or page fault) |
| |
| <li>0x2 – verify data after reading by re-reading and compare |
| </ul> |
| |
| <p>Result message:</p> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| R • <i><token></i> • <i><string: BASE64 encoded byte array></i> • <i><error report></i> • <i><array of error addresses></i> • |
| </font></b></pre> |
| |
| <p>Error report provides integer error code and a short, human readable explanation |
| of error. Error addresses, when present, let client know which bytes of data failed |
| to be retrieved from memory.</p> |
| |
| <h3><a name='CmdFillMemory'>Fill Memory</a></h3> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| C • <token> • Memory • fill • |
| <i><string: context ID></i> • <i><int: address></i> • <i><int: word size></i> • |
| <int: byte count> • <i><int: mode></i> • <i><array: array of pattern bytes></i> • |
| </font></b></pre> |
| |
| <p>Writes pattern bytes at given address in memory, "word size" bytes at a time. Address |
| should be aligned by "word size". If "byte count" is bigger then pattern size, then |
| pattern is repeated necessary number of times. Context ID must be one returned by |
| getContexts. Mode is logical OR of any combination of:</p> |
| |
| <ul type='disc'> |
| <li>0x1 – continue on error (like bus error or page fault) |
| |
| <li>0x2 – verify data after writing by reading back and compare |
| </ul> |
| |
| <p>Result message:</p> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| R • <i><token></i> • <i><error report></i> • <i><array of error addresses></i> • |
| </font></b></pre> |
| |
| <p>Error report provides integer error code and a short, human readable explanation |
| of error. Error addresses, when present, let client know which bytes of data failed |
| to be written into memory.</p> |
| |
| <h2><a name='Events'>Events</a></h2> |
| |
| <p>Memory service broadcasts notification events when memory contexts are added, removed |
| or changed, and when memory content is altered by "set" or "fill" commands.</p> |
| |
| <pre><b><font face="Courier New" size=2 color=#333399> |
| E • Memory • contextAdded • <i><array of context data></i> • |
| E • Memory • contextChanged • <i><array of context data></i> • |
| E • Memory • contextRemoved • <i><array of context IDs></i> • |
| E • Memory • memoryChanged • <i><string: context ID></i> • <i><array of address ranges></i> • |
| |
| <i><array of context data></i> <font face="Times New Roman" size=3>- see Get Contexts command.</font> |
| |
| <i><array of context IDs></i> |
| ⇒ [ <i><context ID list></i> ] |
| |
| <i><context ID list></i> |
| ⇒ <i><string: context ID></i> |
| ⇒ <i><context ID list></i> , <i><string: context ID></i> |
| |
| <i><array of address ranges></i> |
| ⇒ null |
| ⇒ [ <i><address ranges list></i> ] |
| |
| <i><address ranges list></i> |
| ⇒ <i><address range></i> |
| ⇒ <i><address ranges list></i> , <i><address range></i> |
| |
| <i><address range></i> |
| ⇒ { "addr" : <i><int: range starting address></i> , "size" : <i><int: range length in bytes></i> } |
| </font></b></pre> |
| |
| <h2><a name='API'>API</a></h2> |
| |
| <pre> |
| <font color=#3F5FBF>/** |
| * IMemory service provides basic operations to read/write memory on a target. |
| */</font> |
| <font color=#7F0055>public interface</font> Memory <font color=#7F0055>extends</font> Service { |
| |
| <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 – context ID. |
| * <font color=#7F9FBF>@param</font> done - callback interface called when operation is completed. |
| */</font> |
| IToken getContext(String id, DoneGetContext done); |
| |
| <font color=#3F5FBF>/** |
| * Client callback interface for getContext(). |
| */</font> |
| <font color=#7F0055>interface</font> DoneGetContext { |
| <font color=#3F5FBF>/** |
| * Called when contexts data retrieval is done. |
| * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded. |
| * <font color=#7F9FBF>@param</font> context – context data. |
| */</font> |
| <font color=#7F0055>void</font> doneGetContext(IToken token, Exception error, MemoryContext context); |
| } |
| |
| <font color=#3F5FBF>/** |
| * Retrieve contexts available for memory commands. |
| * A context corresponds to an execution thread, process, address space, etc. |
| * A context can belong to a parent context. Contexts hierarchy can be simple |
| * plain list or it can form a tree. It is up to target agent developers to choose |
| * layout that is most descriptive for a given target. Context IDs are valid across |
| * all services. In other words, all services access same hierarchy of contexts, |
| * with same IDs, however, each service accesses its own subset of context's |
| * attributes and functionality, which is relevant to that service. |
| * |
| * <font color=#7F9FBF>@param</font> parent_context_id – parent context ID. Can be null – |
| * to retrieve top level of the hierarchy, or one of context IDs retrieved |
| * by previous getContexts commands. |
| * <font color=#7F9FBF>@param</font> done - callback interface called when operation is completed. |
| */</font> |
| IToken getChildren(String parent_context_id, DoneGetChildren done); |
| |
| <font color=#3F5FBF>/** |
| * Client callback interface for getChildren(). |
| */</font> |
| <font color=#7F0055>interface</font> DoneGetChildren { |
| <font color=#3F5FBF>/** |
| * Called when contexts data retrieval is done. |
| * <font color=#7F9FBF>@param</font> error – error description if operation failed, null if succeeded. |
| * <font color=#7F9FBF>@param</font> contexts – array of available context IDs. |
| */</font> |
| <font color=#7F0055>void</font> doneGetChildren(IToken token, Exception error, String[] context_ids); |
| } |
| |
| <font color=#3F5FBF>/** |
| * Memory access mode: |
| * Carry on when some of the memory cannot be accessed and |
| * return MemoryError at the end if any of the bytes |
| * were not processed correctly. |
| */</font> |
| <font color=#7F0055>final static int</font> MODE_CONTINUEONERROR = 0x1; |
| |
| <font color=#3F5FBF>/** |
| * Memory access mode: |
| * Verify result of memory operations (by reading and comparing). |
| */</font> |
| <font color=#7F0055>final static int</font> MODE_VERIFY = 0x2; |
| |
| <font color=#7F0055>interface</font> MemoryContext { |
| |
| <font color=#3F5FBF>/** |
| * Get context ID. |
| * <font color=#7F9FBF>@return</font> context ID. |
| */</font> |
| String getID(); |
| |
| <font color=#3F5FBF>/** |
| * Get parent context ID. |
| * <font color=#7F9FBF>@return</font> parent ID. |
| */</font> |
| 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> |
| <font color=#7F0055>int</font> 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<String> getAccessTypes(); |
| |
| <font color=#3F5FBF>/** |
| * Get context properties. |
| * <font color=#7F9FBF>@return</font> all available context properties. |
| */</font> |
| Map<String,Object> getProperties(); |
| |
| <font color=#3F5FBF>/** |
| * Set target memory. |
| * If 'word_size' is 0 it means client does not care about word size. |
| */</font> |
| <font color=#7F0055>void</font> set(long addr, <font color=#7F0055>int</font> word_size, byte[] buf, |
| <font color=#7F0055>int</font> offs, <font color=#7F0055>int</font> size, <font color=#7F0055>int</font> mode, DoneMemory done); |
| |
| <font color=#3F5FBF>/** |
| * Read target memory. |
| */</font> |
| <font color=#7F0055>void</font> get(long addr, <font color=#7F0055>int</font> word_size, byte[] buf, |
| <font color=#7F0055>int</font> offs, <font color=#7F0055>int</font> size, <font color=#7F0055>int</font> mode, DoneMemory done); |
| |
| <font color=#3F5FBF>/** |
| * Fill target memory with given pattern. |
| * 'size' is number of bytes to fill. |
| */</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=#7F0055>class</font> MemoryError <font color=#7F0055>extends</font> Exception { |
| } |
| |
| <font color=#3F5FBF>/** |
| * ErrorOffset interface can be implemented by MemoryError object, |
| * which is returned by get, set and fill commands. |
| * |
| * get/set/fill () returns this exception when reading failed |
| * for some but not all bytes, and MODE_CONTINUEONERROR |
| * has been set in mode. (For example, when only part of the request |
| * translates to valid memory addresses.) |
| * Exception.getMessage can be used for generalized message of the |
| * possible reasons of partial memory operation. |
| */</font> |
| <font color=#7F0055>interface</font> ErrorOffset { |
| |
| // Error may have per byte information |
| <font color=#7F0055>final static int</font> |
| BYTE_VALID = 0x00, |
| BYTE_UNKNOWN = 0x01, // e.g. out of range |
| BYTE_INVALID = 0x02, |
| BYTE_CANNOT_READ = 0x04, |
| BYTE_CANNOT_WRITE = 0x08; |
| |
| <font color=#7F0055>int</font> getStatus(<font color=#7F0055>int</font> offset); |
| |
| <font color=#3F5FBF>/** |
| * Returns the detail message string about the |
| * byte associated with specified location. |
| * <font color=#7F9FBF>@return</font> the detail error message string. |
| */</font> |
| String getMessage(<font color=#7F0055>int</font> offset); |
| |
| } |
| |
| <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>/** |
| * Called when a new memory access context(s) is created. |
| */</font> |
| <font color=#7F0055>void</font> contextAdded(Context[] contexts); |
| |
| <font color=#3F5FBF>/** |
| * Called when a new memory access context(s) properties changed. |
| */</font> |
| <font color=#7F0055>void</font> contextChanged(Context[] contexts); |
| |
| <font color=#3F5FBF>/** |
| * Called when memory access context(s) is removed. |
| */</font> |
| <font color=#7F0055>void</font> contextRemoved(String[] context_ids); |
| |
| <font color=#3F5FBF>/** |
| * Called when target memory content was changed and clients |
| * need to update themselves. Clients, at least, should invalidate |
| * corresponding cached memory data. |
| * Not every change is notified - it is not possible, |
| * only those, which are not caused by normal execution of the debuggee. |
| * ‘addr’ and ‘size’ can be null if unknown. |
| */</font> |
| <font color=#7F0055>void</font> memoryChanged(String context_id, |
| long[] addr, long[] size); |
| } |
| } |
| </pre> |
| |
| </body> |
| </html> |