1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

Bug 319890 - [memory] When nothing is selected in Debug view, memory browser still shows data

This commit is contained in:
Pawel Piech 2010-07-14 18:18:13 +00:00
parent ae0d300399
commit 016c840b51

View file

@ -780,17 +780,23 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
if(defaultRenderingTypeId == null) if(defaultRenderingTypeId == null)
return; return;
IAdaptable adaptable = null;
IMemoryBlockRetrieval retrieval = null;
ILaunch launch = null;
if(context instanceof IAdaptable) if(context instanceof IAdaptable)
{ {
IAdaptable adaptable = (IAdaptable) context; adaptable = (IAdaptable) context;
final IMemoryBlockRetrieval retrieval = ((IMemoryBlockRetrieval) adaptable.getAdapter(IMemoryBlockRetrieval.class)); retrieval = ((IMemoryBlockRetrieval) adaptable.getAdapter(IMemoryBlockRetrieval.class));
ILaunch launch = ((ILaunch) adaptable.getAdapter(ILaunch.class)); launch = ((ILaunch) adaptable.getAdapter(ILaunch.class));
}
if(retrieval != null && launch != null && !launch.isTerminated()) { if(retrieval != null && launch != null && !launch.isTerminated()) {
if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) { if (retrieval instanceof IMemorySpaceAwareMemoryBlockRetrieval) {
final IMemoryBlockRetrieval _retrieval = retrieval;
((IMemorySpaceAwareMemoryBlockRetrieval)retrieval).getMemorySpaces(context, new GetMemorySpacesRequest(){ ((IMemorySpaceAwareMemoryBlockRetrieval)retrieval).getMemorySpaces(context, new GetMemorySpacesRequest(){
public void done() { public void done() {
updateTab(retrieval, context, isSuccess() ? getMemorySpaces() : new String[0]); updateTab(_retrieval, context, isSuccess() ? getMemorySpaces() : new String[0]);
} }
}); });
} }
@ -805,7 +811,6 @@ public class MemoryBrowser extends ViewPart implements IDebugContextListener, IM
fGotoMemorySpaceControl.pack(true); fGotoMemorySpaceControl.pack(true);
fStackLayout.topControl.getParent().layout(true); fStackLayout.topControl.getParent().layout(true);
} }
}
/** /**
* Called to update the tab once the asynchronous query for memory spaces * Called to update the tab once the asynchronous query for memory spaces