mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-04 14:55:41 +02:00
[192019] View Model refactoring cont.: fixed refactoring bugs found during PDA development.
This commit is contained in:
parent
bd49549561
commit
2beca67145
8 changed files with 28 additions and 29 deletions
|
@ -416,7 +416,7 @@ public class MISourceDisplayAdapter implements ISourceDisplay
|
|||
fServicesTracker.dispose();
|
||||
fSourceLookup.removeParticipants(new ISourceLookupParticipant[] {fSourceLookupParticipant});
|
||||
|
||||
// fSourceLookupParticipant is disposed by teh source lookup director
|
||||
// fSourceLookupParticipant is disposed by the source lookup director
|
||||
|
||||
// Need to remove annotations in UI thread.
|
||||
//fIPManager.removeAllAnnotations();
|
||||
|
|
|
@ -262,6 +262,7 @@ public class StackFramesVMNode extends AbstractDMVMNode
|
|||
@Override
|
||||
protected void handleFailedUpdate(IViewerUpdate update) {
|
||||
if (update instanceof ILabelUpdate) {
|
||||
update.done();
|
||||
// Avoid repainting the label if it's not available. This only slows
|
||||
// down the display.
|
||||
} else {
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterDMData;
|
|||
import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterGroupDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterGroupDMData;
|
||||
import org.eclipse.dd.dsf.debug.ui.DsfDebugUIPlugin;
|
||||
import org.eclipse.dd.dsf.service.DsfServiceID;
|
||||
import org.eclipse.dd.dsf.service.DsfServices;
|
||||
import org.eclipse.dd.dsf.service.DsfSession;
|
||||
import org.eclipse.dd.dsf.service.IDsfService;
|
||||
import org.eclipse.dd.dsf.ui.viewmodel.dm.IDMVMContext;
|
||||
|
@ -63,7 +63,7 @@ public class SyncRegisterDataAccess {
|
|||
@ThreadSafe
|
||||
private synchronized IRegisters getService() {
|
||||
|
||||
String serviceId = DsfServiceID.createServiceId( IRegisters.class, fSession.getId() );
|
||||
String serviceId = DsfServices.createServiceFilter( IRegisters.class, fSession.getId() );
|
||||
if (fServiceTracker == null) {
|
||||
try {
|
||||
fServiceTracker = new ServiceTracker(
|
||||
|
|
|
@ -415,7 +415,7 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens
|
|||
final Addr64 address = new Addr64(bigAddress);
|
||||
final int word_size = 1;
|
||||
|
||||
// Use a Query to synchronise the downstream calls
|
||||
// Use a Query to synchronize the downstream calls
|
||||
Query<MemoryByte[]> query = new Query<MemoryByte[]>() {
|
||||
@Override
|
||||
protected void execute(final DataRequestMonitor<MemoryByte[]> drm) {
|
||||
|
|
|
@ -33,7 +33,7 @@ import org.eclipse.dd.dsf.debug.service.IExpressions.IExpressionDMContext;
|
|||
import org.eclipse.dd.dsf.debug.service.IFormattedValues.FormattedValueDMContext;
|
||||
import org.eclipse.dd.dsf.debug.service.IFormattedValues.FormattedValueDMData;
|
||||
import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryDMContext;
|
||||
import org.eclipse.dd.dsf.service.DsfServiceID;
|
||||
import org.eclipse.dd.dsf.service.DsfServices;
|
||||
import org.eclipse.dd.dsf.service.DsfSession;
|
||||
import org.eclipse.dd.dsf.service.IDsfService;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
|
@ -94,7 +94,7 @@ public class DsfMemoryBlockRetrieval extends PlatformObject implements IMemoryBl
|
|||
// amalgamated one because it is less error prone (and we are lazy).
|
||||
|
||||
// Create a tracker for the MemoryService
|
||||
String memoryServiceFilter = DsfServiceID.createServiceId( IMemory.class, dmc.getSessionId() );
|
||||
String memoryServiceFilter = DsfServices.createServiceFilter( IMemory.class, dmc.getSessionId() );
|
||||
|
||||
try {
|
||||
fMemoryServiceTracker = new ServiceTracker(
|
||||
|
|
|
@ -113,10 +113,13 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor
|
|||
}
|
||||
}
|
||||
|
||||
if(e[0] instanceof RuntimeException)
|
||||
if(e[0] instanceof RuntimeException) {
|
||||
throw (RuntimeException) e[0];
|
||||
else if(e[0] instanceof Exception)
|
||||
} else if (e[0] instanceof Error) {
|
||||
throw (Error) e[0];
|
||||
} else if(e[0] instanceof Exception) {
|
||||
throw (Exception) e[0];
|
||||
}
|
||||
|
||||
return (V) v[0];
|
||||
}
|
||||
|
@ -140,15 +143,10 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor
|
|||
|
||||
return new Runnable() {
|
||||
public void run() {
|
||||
final Throwable[] e = new Throwable[1];
|
||||
try {
|
||||
fDisplay.syncExec(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
runnable.run();
|
||||
} catch(Throwable exception) {
|
||||
e[0] = exception;
|
||||
}
|
||||
runnable.run();
|
||||
}
|
||||
});
|
||||
} catch (SWTException swtException) {
|
||||
|
@ -156,8 +154,6 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor
|
|||
DisplayDsfExecutor.super.shutdown();
|
||||
}
|
||||
}
|
||||
if(e[0] instanceof RuntimeException)
|
||||
throw (RuntimeException) e[0];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -251,9 +247,4 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor
|
|||
public List<Runnable> shutdownNow() {
|
||||
return (List<Runnable>)Collections.EMPTY_LIST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isShutdown() {
|
||||
return super.isShutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -301,6 +301,8 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
|||
if(getStatus().isOK()) {
|
||||
entry.fHasChildren = this.getData();
|
||||
update.setHasChilren(getData());
|
||||
} else {
|
||||
update.setStatus(getStatus());
|
||||
}
|
||||
update.done();
|
||||
}
|
||||
|
@ -333,6 +335,8 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
|||
if(getStatus().isOK()) {
|
||||
entry.fChildrenCount = this.getData();
|
||||
update.setChildCount(getData());
|
||||
} else {
|
||||
update.setStatus(getStatus());
|
||||
}
|
||||
update.done();
|
||||
}
|
||||
|
@ -753,4 +757,5 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,16 +12,18 @@
|
|||
package org.eclipse.dd.dsf.service;
|
||||
|
||||
/**
|
||||
* Convenience class to create the somewhat complicated service ID which
|
||||
* can then be used with the DsfServicesTracker or OSGI services tracker
|
||||
* to find a desired service.
|
||||
* Utility class containing status methods to use with DSF services.
|
||||
*/
|
||||
public class DsfServices {
|
||||
|
||||
public class DsfServiceID {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static String createServiceId(Class serviceClass, String sessionId) {
|
||||
|
||||
/**
|
||||
* Creates a properly formatted OSGi service filter for a DSF service based
|
||||
* on service class and session ID.
|
||||
* @param serviceClass Class of the service to create the filter for.
|
||||
* @param sessionId Session ID of the session that the service belongs to.
|
||||
* @return Filter string to identify the given service.
|
||||
*/
|
||||
public static String createServiceFilter(Class<?> serviceClass, String sessionId) {
|
||||
String serviceId =
|
||||
"(&" + //$NON-NLS-1$
|
||||
"(OBJECTCLASS=" + //$NON-NLS-1$
|
Loading…
Add table
Reference in a new issue