Skip to main content
summaryrefslogtreecommitdiffstats
path: root/dsf
diff options
context:
space:
mode:
authorAlvaro Sanchez-Leon2016-02-22 15:42:48 -0500
committerGerrit Code Review @ Eclipse.org2016-04-07 15:48:16 -0400
commit2655b4a0f3f069090e678077dcee90bc3b2a42c2 (patch)
tree07e951c0269f3c8a91181ee9a6c8e30435f6d645 /dsf
parentf9d3a184aa9757b3e1110d9f43877dd8e6258e18 (diff)
downloadorg.eclipse.cdt-2655b4a0f3f069090e678077dcee90bc3b2a42c2.tar.gz
org.eclipse.cdt-2655b4a0f3f069090e678077dcee90bc3b2a42c2.tar.xz
org.eclipse.cdt-2655b4a0f3f069090e678077dcee90bc3b2a42c2.zip
Bug 489501 - [memory] Add API to resolve the default memory space id
When using memory spaces, a backend may sometimes qualify an address to specify the memory space to which the address belongs. However, to minimize impacts, the memory space qualifier may not always be present. In such cases, the address is implied to belong to the "default" memory space. DSF-GDB currently has no means to know what is the "default" memory space to apply in such cases. This change introduces a new API to request the default memory space from the memory service. Change-Id: Icea87543b8529756aee92c6d2af95fb936f5fb9c
Diffstat (limited to 'dsf')
-rw-r--r--dsf/org.eclipse.cdt.dsf/.settings/.api_filters8
-rw-r--r--dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMemorySpaces.java20
2 files changed, 28 insertions, 0 deletions
diff --git a/dsf/org.eclipse.cdt.dsf/.settings/.api_filters b/dsf/org.eclipse.cdt.dsf/.settings/.api_filters
index 346ffc9148..b1c14666cf 100644
--- a/dsf/org.eclipse.cdt.dsf/.settings/.api_filters
+++ b/dsf/org.eclipse.cdt.dsf/.settings/.api_filters
@@ -8,4 +8,12 @@
</message_arguments>
</filter>
</resource>
+ <resource path="src/org/eclipse/cdt/dsf/debug/service/IMemorySpaces.java" type="org.eclipse.cdt.dsf.debug.service.IMemorySpaces">
+ <filter id="403804204">
+ <message_arguments>
+ <message_argument value="org.eclipse.cdt.dsf.debug.service.IMemorySpaces"/>
+ <message_argument value="getDefaultMemorySpace(IDMContext, DataRequestMonitor&lt;String&gt;)"/>
+ </message_arguments>
+ </filter>
+ </resource>
</component>
diff --git a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMemorySpaces.java b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMemorySpaces.java
index 78d9ca0764..9a9cd5c44e 100644
--- a/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMemorySpaces.java
+++ b/dsf/org.eclipse.cdt.dsf/src/org/eclipse/cdt/dsf/debug/service/IMemorySpaces.java
@@ -103,4 +103,24 @@ public interface IMemorySpaces extends IDsfService{
* select a memory space when being prompted for a memory location.
*/
public boolean creatingBlockRequiresMemorySpaceID();
+
+ /**
+ * Provides the default memory space to be used in the given context.
+ *
+ * @param ctx
+ * a context which might <i>contain</i> one or more memory
+ * spaces. Contexts that may be <i>associated</i> with a memory
+ * space should not be passed in. E.g., an expression might be
+ * associated with a memory space, but it does not contain memory
+ * spaces, and is thus not an appropriate context for this
+ * method.
+ * @param rm
+ * the asynchronous data request monitor. Returns a memory space ID.
+ * Never null, but may be empty.
+ * @since 2.7
+ */
+ default void getDefaultMemorySpace(IDMContext context, final DataRequestMonitor<String> rm) {
+ rm.setData(""); //$NON-NLS-1$
+ rm.done();
+ }
}

Back to the top