mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-21 07:55:24 +02:00
[292271] DsfSession.addServiceEventListener must be used on the Executor thread.
This commit is contained in:
parent
4752115f03
commit
e436aadfcd
2 changed files with 41 additions and 15 deletions
|
@ -1765,7 +1765,6 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
String debuggerPath= file;
|
String debuggerPath= file;
|
||||||
|
|
||||||
// try reverse lookup
|
// try reverse lookup
|
||||||
final ISourceLookup lookup= getService(ISourceLookup.class);
|
|
||||||
final ISourceLookupDMContext ctx= DMContexts.getAncestorOfType(fTargetContext, ISourceLookupDMContext.class);
|
final ISourceLookupDMContext ctx= DMContexts.getAncestorOfType(fTargetContext, ISourceLookupDMContext.class);
|
||||||
final DsfExecutor executor= getSession().getExecutor();
|
final DsfExecutor executor= getSession().getExecutor();
|
||||||
Query<String> query= new Query<String>() {
|
Query<String> query= new Query<String>() {
|
||||||
|
@ -1778,6 +1777,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
rm.done();
|
rm.done();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
final ISourceLookup lookup= getService(ISourceLookup.class);
|
||||||
lookup.getDebuggerPath(ctx, file, request);
|
lookup.getDebuggerPath(ctx, file, request);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -2361,14 +2361,22 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
}
|
}
|
||||||
if (fTargetContext != null) {
|
if (fTargetContext != null) {
|
||||||
if (fDebugSessionId != null) {
|
if (fDebugSessionId != null) {
|
||||||
if (getSession() != null) {
|
if (getSession() != null) {
|
||||||
getSession().removeServiceEventListener(this);
|
// Store the values that we are going to change
|
||||||
|
final DsfSession session = getSession();
|
||||||
|
final DsfServicesTracker trackerToDispose= fServicesTracker;
|
||||||
|
session.getExecutor().execute(new DsfRunnable() {
|
||||||
|
public void run() {
|
||||||
|
session.removeServiceEventListener(DisassemblyPart.this);
|
||||||
|
if (trackerToDispose != null) {
|
||||||
|
trackerToDispose.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fDebugSessionId= sessionId;
|
fDebugSessionId= sessionId;
|
||||||
if (fServicesTracker != null) {
|
|
||||||
fServicesTracker.dispose();
|
|
||||||
}
|
|
||||||
fServicesTracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), sessionId);
|
fServicesTracker = new DsfServicesTracker(DsfUIPlugin.getBundleContext(), sessionId);
|
||||||
if (fViewer != null) {
|
if (fViewer != null) {
|
||||||
debugContextChanged();
|
debugContextChanged();
|
||||||
|
@ -2389,14 +2397,22 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
}
|
}
|
||||||
} else if (fDebugSessionId != null) {
|
} else if (fDebugSessionId != null) {
|
||||||
if (getSession() != null) {
|
if (getSession() != null) {
|
||||||
getSession().removeServiceEventListener(this);
|
// Store the values that we are going to change
|
||||||
|
final DsfSession session = getSession();
|
||||||
|
final DsfServicesTracker trackerToDispose= fServicesTracker;
|
||||||
|
session.getExecutor().execute(new DsfRunnable() {
|
||||||
|
public void run() {
|
||||||
|
session.removeServiceEventListener(DisassemblyPart.this);
|
||||||
|
if (trackerToDispose != null) {
|
||||||
|
trackerToDispose.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
fDebugSessionId= null;
|
fDebugSessionId= null;
|
||||||
fTargetContext= null;
|
fTargetContext= null;
|
||||||
if (fServicesTracker != null) {
|
fServicesTracker= null;
|
||||||
fServicesTracker.dispose();
|
|
||||||
fServicesTracker= null;
|
|
||||||
}
|
|
||||||
if (fViewer != null) {
|
if (fViewer != null) {
|
||||||
debugContextChanged();
|
debugContextChanged();
|
||||||
}
|
}
|
||||||
|
@ -2410,7 +2426,12 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
resetViewer();
|
resetViewer();
|
||||||
if (fDebugSessionId != null) {
|
if (fDebugSessionId != null) {
|
||||||
final DsfSession session= getSession();
|
final DsfSession session= getSession();
|
||||||
session.addServiceEventListener(this, null);
|
session.getExecutor().execute(new DsfRunnable() {
|
||||||
|
public void run() {
|
||||||
|
session.addServiceEventListener(DisassemblyPart.this, null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
updatePC(PC_UNKNOWN);
|
updatePC(PC_UNKNOWN);
|
||||||
|
|
||||||
if (fGotoAddressPending != PC_UNKNOWN) {
|
if (fGotoAddressPending != PC_UNKNOWN) {
|
||||||
|
|
|
@ -591,7 +591,9 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
|
||||||
final IInstructionPointerPresentation ipPresentation = (IInstructionPointerPresentation) session.getModelAdapter(IInstructionPointerPresentation.class);
|
final IInstructionPointerPresentation ipPresentation = (IInstructionPointerPresentation) session.getModelAdapter(IInstructionPointerPresentation.class);
|
||||||
fIPManager = new InstructionPointerManager(ipPresentation);
|
fIPManager = new InstructionPointerManager(ipPresentation);
|
||||||
|
|
||||||
fSession.addServiceEventListener(this, null);
|
fExecutor.execute(new DsfRunnable() { public void run() {
|
||||||
|
fSession.addServiceEventListener(DsfSourceDisplayAdapter.this, null);
|
||||||
|
}});
|
||||||
|
|
||||||
fController = controller;
|
fController = controller;
|
||||||
if (fController != null) {
|
if (fController != null) {
|
||||||
|
@ -616,8 +618,11 @@ public class DsfSourceDisplayAdapter implements ISourceDisplay, ISteppingControl
|
||||||
fController.removeSteppingControlParticipant(this);
|
fController.removeSteppingControlParticipant(this);
|
||||||
fController = null;
|
fController = null;
|
||||||
}
|
}
|
||||||
fSession.removeServiceEventListener(this);
|
fExecutor.execute(new DsfRunnable() { public void run() {
|
||||||
fServicesTracker.dispose();
|
fSession.removeServiceEventListener(DsfSourceDisplayAdapter.this);
|
||||||
|
fServicesTracker.dispose();
|
||||||
|
}});
|
||||||
|
|
||||||
fSourceLookup.removeParticipants(new ISourceLookupParticipant[] {fSourceLookupParticipant});
|
fSourceLookup.removeParticipants(new ISourceLookupParticipant[] {fSourceLookupParticipant});
|
||||||
|
|
||||||
// fSourceLookupParticipant is disposed by the source lookup director
|
// fSourceLookupParticipant is disposed by the source lookup director
|
||||||
|
|
Loading…
Add table
Reference in a new issue