From 2655b4a0f3f069090e678077dcee90bc3b2a42c2 Mon Sep 17 00:00:00 2001 From: Alvaro Sanchez-Leon Date: Mon, 22 Feb 2016 21:42:48 +0100 Subject: [PATCH] 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 --- .../.settings/.api_filters | 8 ++++++++ .../cdt/dsf/debug/service/IMemorySpaces.java | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/dsf/org.eclipse.cdt.dsf/.settings/.api_filters b/dsf/org.eclipse.cdt.dsf/.settings/.api_filters index 346ffc91488..b1c14666cf1 100644 --- a/dsf/org.eclipse.cdt.dsf/.settings/.api_filters +++ b/dsf/org.eclipse.cdt.dsf/.settings/.api_filters @@ -8,4 +8,12 @@ + + + + + + + + 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 78d9ca0764c..9a9cd5c44e2 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 contain one or more memory + * spaces. Contexts that may be associated 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 rm) { + rm.setData(""); //$NON-NLS-1$ + rm.done(); + } }