mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 15:25:49 +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();
|
fServicesTracker.dispose();
|
||||||
fSourceLookup.removeParticipants(new ISourceLookupParticipant[] {fSourceLookupParticipant});
|
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.
|
// Need to remove annotations in UI thread.
|
||||||
//fIPManager.removeAllAnnotations();
|
//fIPManager.removeAllAnnotations();
|
||||||
|
|
|
@ -262,6 +262,7 @@ public class StackFramesVMNode extends AbstractDMVMNode
|
||||||
@Override
|
@Override
|
||||||
protected void handleFailedUpdate(IViewerUpdate update) {
|
protected void handleFailedUpdate(IViewerUpdate update) {
|
||||||
if (update instanceof ILabelUpdate) {
|
if (update instanceof ILabelUpdate) {
|
||||||
|
update.done();
|
||||||
// Avoid repainting the label if it's not available. This only slows
|
// Avoid repainting the label if it's not available. This only slows
|
||||||
// down the display.
|
// down the display.
|
||||||
} else {
|
} 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.IRegisterGroupDMContext;
|
||||||
import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterGroupDMData;
|
import org.eclipse.dd.dsf.debug.service.IRegisters.IRegisterGroupDMData;
|
||||||
import org.eclipse.dd.dsf.debug.ui.DsfDebugUIPlugin;
|
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.DsfSession;
|
||||||
import org.eclipse.dd.dsf.service.IDsfService;
|
import org.eclipse.dd.dsf.service.IDsfService;
|
||||||
import org.eclipse.dd.dsf.ui.viewmodel.dm.IDMVMContext;
|
import org.eclipse.dd.dsf.ui.viewmodel.dm.IDMVMContext;
|
||||||
|
@ -63,7 +63,7 @@ public class SyncRegisterDataAccess {
|
||||||
@ThreadSafe
|
@ThreadSafe
|
||||||
private synchronized IRegisters getService() {
|
private synchronized IRegisters getService() {
|
||||||
|
|
||||||
String serviceId = DsfServiceID.createServiceId( IRegisters.class, fSession.getId() );
|
String serviceId = DsfServices.createServiceFilter( IRegisters.class, fSession.getId() );
|
||||||
if (fServiceTracker == null) {
|
if (fServiceTracker == null) {
|
||||||
try {
|
try {
|
||||||
fServiceTracker = new ServiceTracker(
|
fServiceTracker = new ServiceTracker(
|
||||||
|
|
|
@ -415,7 +415,7 @@ public class DsfMemoryBlock extends PlatformObject implements IMemoryBlockExtens
|
||||||
final Addr64 address = new Addr64(bigAddress);
|
final Addr64 address = new Addr64(bigAddress);
|
||||||
final int word_size = 1;
|
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[]>() {
|
Query<MemoryByte[]> query = new Query<MemoryByte[]>() {
|
||||||
@Override
|
@Override
|
||||||
protected void execute(final DataRequestMonitor<MemoryByte[]> drm) {
|
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.FormattedValueDMContext;
|
||||||
import org.eclipse.dd.dsf.debug.service.IFormattedValues.FormattedValueDMData;
|
import org.eclipse.dd.dsf.debug.service.IFormattedValues.FormattedValueDMData;
|
||||||
import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryDMContext;
|
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.DsfSession;
|
||||||
import org.eclipse.dd.dsf.service.IDsfService;
|
import org.eclipse.dd.dsf.service.IDsfService;
|
||||||
import org.eclipse.debug.core.DebugException;
|
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).
|
// amalgamated one because it is less error prone (and we are lazy).
|
||||||
|
|
||||||
// Create a tracker for the MemoryService
|
// Create a tracker for the MemoryService
|
||||||
String memoryServiceFilter = DsfServiceID.createServiceId( IMemory.class, dmc.getSessionId() );
|
String memoryServiceFilter = DsfServices.createServiceFilter( IMemory.class, dmc.getSessionId() );
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fMemoryServiceTracker = new ServiceTracker(
|
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];
|
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];
|
throw (Exception) e[0];
|
||||||
|
}
|
||||||
|
|
||||||
return (V) v[0];
|
return (V) v[0];
|
||||||
}
|
}
|
||||||
|
@ -140,15 +143,10 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor
|
||||||
|
|
||||||
return new Runnable() {
|
return new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
final Throwable[] e = new Throwable[1];
|
|
||||||
try {
|
try {
|
||||||
fDisplay.syncExec(new Runnable() {
|
fDisplay.syncExec(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
|
||||||
runnable.run();
|
runnable.run();
|
||||||
} catch(Throwable exception) {
|
|
||||||
e[0] = exception;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (SWTException swtException) {
|
} catch (SWTException swtException) {
|
||||||
|
@ -156,8 +154,6 @@ public class DisplayDsfExecutor extends DefaultDsfExecutor
|
||||||
DisplayDsfExecutor.super.shutdown();
|
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() {
|
public List<Runnable> shutdownNow() {
|
||||||
return (List<Runnable>)Collections.EMPTY_LIST;
|
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()) {
|
if(getStatus().isOK()) {
|
||||||
entry.fHasChildren = this.getData();
|
entry.fHasChildren = this.getData();
|
||||||
update.setHasChilren(getData());
|
update.setHasChilren(getData());
|
||||||
|
} else {
|
||||||
|
update.setStatus(getStatus());
|
||||||
}
|
}
|
||||||
update.done();
|
update.done();
|
||||||
}
|
}
|
||||||
|
@ -333,6 +335,8 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
if(getStatus().isOK()) {
|
if(getStatus().isOK()) {
|
||||||
entry.fChildrenCount = this.getData();
|
entry.fChildrenCount = this.getData();
|
||||||
update.setChildCount(getData());
|
update.setChildCount(getData());
|
||||||
|
} else {
|
||||||
|
update.setStatus(getStatus());
|
||||||
}
|
}
|
||||||
update.done();
|
update.done();
|
||||||
}
|
}
|
||||||
|
@ -753,4 +757,5 @@ public class AbstractCachingVMProvider extends AbstractVMProvider implements ICa
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,16 +12,18 @@
|
||||||
package org.eclipse.dd.dsf.service;
|
package org.eclipse.dd.dsf.service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convenience class to create the somewhat complicated service ID which
|
* Utility class containing status methods to use with DSF services.
|
||||||
* can then be used with the DsfServicesTracker or OSGI services tracker
|
|
||||||
* to find a desired service.
|
|
||||||
*/
|
*/
|
||||||
|
public class DsfServices {
|
||||||
|
|
||||||
public class DsfServiceID {
|
/**
|
||||||
|
* Creates a properly formatted OSGi service filter for a DSF service based
|
||||||
@SuppressWarnings("unchecked")
|
* on service class and session ID.
|
||||||
public static String createServiceId(Class serviceClass, String sessionId) {
|
* @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 =
|
String serviceId =
|
||||||
"(&" + //$NON-NLS-1$
|
"(&" + //$NON-NLS-1$
|
||||||
"(OBJECTCLASS=" + //$NON-NLS-1$
|
"(OBJECTCLASS=" + //$NON-NLS-1$
|
Loading…
Add table
Reference in a new issue