mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-11 18:25:40 +02:00
Bug 309032: Need APIs to support memory pages (add ability for backend to indicate a memory space qualification is necessary)
This commit is contained in:
parent
4a6ea58842
commit
4578a2a5ca
5 changed files with 60 additions and 9 deletions
|
@ -93,4 +93,11 @@ public interface IMemorySpaceAwareMemoryBlockRetrieval extends IMemoryBlockRetri
|
|||
*/
|
||||
public IMemorySpaceAwareMemoryBlock getMemoryBlock(String expression, Object context, String memorySpaceID) throws DebugException;
|
||||
|
||||
/**
|
||||
* Return true if creating a memory block with a null memory space ID is NOT
|
||||
* supported. Some debuggers may not have the ability to infer the memory
|
||||
* space from an expression, in which case the user should be forced to
|
||||
* select a memory space when being prompted for a memory location.
|
||||
*/
|
||||
public boolean creatingBlockRequiresMemorySpaceID();
|
||||
}
|
||||
|
|
|
@ -473,4 +473,13 @@ public class CMemoryBlockRetrievalExtension extends PlatformObject implements IM
|
|||
// Nope; use default decoding
|
||||
return decodeAddressDefault(str);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.model.provisional.IMemorySpaceAwareMemoryBlockRetrieval#creatingBlockRequiresMemorySpaceID()
|
||||
*/
|
||||
public boolean creatingBlockRequiresMemorySpaceID() {
|
||||
// A behavioral control we're not extending to CDI clients, but is being
|
||||
// extended to DSF ones.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -362,4 +362,15 @@ public class GdbMemoryBlockRetrieval extends DsfMemoryBlockRetrieval implements
|
|||
DebugPlugin.getDefault().getMemoryBlockManager().addMemoryBlocks( blocks.toArray(new IMemoryBlock[blocks.size()]));
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.model.provisional.IMemorySpaceAwareMemoryBlockRetrieval#creatingBlockRequiresMemorySpaceID()
|
||||
*/
|
||||
public boolean creatingBlockRequiresMemorySpaceID() {
|
||||
IMemorySpaces memoryPageService = (IMemorySpaces)fMemorySpaceServiceTracker.getService();
|
||||
if (memoryPageService != null) {
|
||||
return memoryPageService.creatingBlockRequiresMemorySpaceID();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,8 +72,19 @@ public interface IMemorySpaces extends IDsfService{
|
|||
/**
|
||||
* Provides the memory spaces available in the given context.
|
||||
*
|
||||
* @param ctx a DM context
|
||||
* @param rm the asynchronous data request monitor
|
||||
* @param ctx
|
||||
* a DM context
|
||||
* @param rm
|
||||
* the asynchronous data request monitor. Returns a collection of
|
||||
* memory space IDs.
|
||||
*/
|
||||
void getMemorySpaces(IDMContext context, final DataRequestMonitor<String[]> rm);
|
||||
|
||||
/**
|
||||
* Return true if creating a memory block with a null memory space ID is NOT
|
||||
* supported. Some debuggers may not have the ability to infer the memory
|
||||
* space from an expression, in which case the user should be forced to
|
||||
* select a memory space when being prompted for a memory location.
|
||||
*/
|
||||
public boolean creatingBlockRequiresMemorySpaceID();
|
||||
}
|
||||
|
|
|
@ -367,11 +367,15 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
|
|||
}
|
||||
|
||||
private void performGo(boolean inNewTab) {
|
||||
// Index zero is the 'auto' (n/a) memory space entry
|
||||
// Index zero is the 'auto' (n/a) memory space entry, unless the backend
|
||||
// said we need to force a memory space selection
|
||||
String memorySpace = null;
|
||||
if (fGotoMemorySpaceControl.isVisible() && (fGotoMemorySpaceControl.getSelectionIndex() != 0)) {
|
||||
if (fGotoMemorySpaceControl.isVisible()) {
|
||||
memorySpace = fGotoMemorySpaceControl.getText();
|
||||
assert (memorySpace != null) && (memorySpace.length() > 0);
|
||||
if (memorySpace.equals(NA_MEMORY_SPACE_ID)) {
|
||||
memorySpace = null;
|
||||
}
|
||||
assert (memorySpace == null) || (memorySpace.length() > 0);
|
||||
}
|
||||
|
||||
String expression = fGotoAddressBar.getExpressionText();
|
||||
|
@ -855,7 +859,16 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
|
|||
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=309032#c50
|
||||
if (memorySpaces.length >= 2) {
|
||||
fGotoMemorySpaceControl.setItems(memorySpaces);
|
||||
fGotoMemorySpaceControl.add(NA_MEMORY_SPACE_ID, 0); //$NON-NLS-1$ the n/a entry; don't think this needs to be translated
|
||||
|
||||
// Add the '----' (N/A) entry unless the retrieval object
|
||||
// says it requires a memory space ID in all cases
|
||||
boolean addNA = true;
|
||||
if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
|
||||
addNA = !((IMemorySpaceAwareMemoryBlockRetrieval)retrieval).creatingBlockRequiresMemorySpaceID();
|
||||
}
|
||||
if (addNA) {
|
||||
fGotoMemorySpaceControl.add(NA_MEMORY_SPACE_ID, 0);
|
||||
}
|
||||
setMemorySpaceControlVisible(true);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Reference in a new issue