mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 235300 [disassembly] AssertionError when switching between multiple debug sessions with active disassembly view
This commit is contained in:
parent
322474d43b
commit
1058d3caf2
1 changed files with 27 additions and 19 deletions
|
@ -191,7 +191,7 @@ import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
|
|||
* DisassemblyPart
|
||||
*/
|
||||
@SuppressWarnings("restriction")
|
||||
public abstract class DisassemblyPart extends WorkbenchPart implements IDisassemblyPart, IViewportListener, ITextPresentationListener {
|
||||
public abstract class DisassemblyPart extends WorkbenchPart implements IDisassemblyPart, IViewportListener, ITextPresentationListener, SessionEndedListener {
|
||||
|
||||
private final static boolean DEBUG = DsfDebugUIPlugin.getDefault().isDebugging();
|
||||
|
||||
|
@ -794,6 +794,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
} else {
|
||||
updateDebugContext();
|
||||
}
|
||||
DsfSession.addSessionEndedListener(this);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -828,12 +829,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
ctxService.deactivateContext(fContextActivation);
|
||||
}
|
||||
fViewer = null;
|
||||
fDebugSessionId = null;
|
||||
fTargetContext= null;
|
||||
if (fServicesTracker != null) {
|
||||
fServicesTracker.dispose();
|
||||
fServicesTracker= null;
|
||||
}
|
||||
setDebugContext(null);
|
||||
DsfSession.removeSessionEndedListener(this);
|
||||
|
||||
fAnnotationAccess = null;
|
||||
fAnnotationPreferences = null;
|
||||
fAnnotationRulerColumn = null;
|
||||
|
@ -2323,12 +2321,17 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
}
|
||||
}
|
||||
if (fTargetContext != null) {
|
||||
if (fDebugSessionId != null) {
|
||||
if (getSession() != null) {
|
||||
getSession().removeServiceEventListener(this);
|
||||
}
|
||||
}
|
||||
fDebugSessionId= sessionId;
|
||||
if (fServicesTracker != null) {
|
||||
fServicesTracker.dispose();
|
||||
}
|
||||
fServicesTracker = new DsfServicesTracker(DsfDebugUIPlugin.getBundleContext(), sessionId);
|
||||
if (fViewer != null) {
|
||||
if (fViewer != null) {
|
||||
debugContextChanged();
|
||||
}
|
||||
}
|
||||
|
@ -2351,6 +2354,10 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
}
|
||||
fDebugSessionId= null;
|
||||
fTargetContext= null;
|
||||
if (fServicesTracker != null) {
|
||||
fServicesTracker.dispose();
|
||||
fServicesTracker= null;
|
||||
}
|
||||
if (fViewer != null) {
|
||||
debugContextChanged();
|
||||
}
|
||||
|
@ -2365,17 +2372,6 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
if (fDebugSessionId != null) {
|
||||
final DsfSession session= getSession();
|
||||
session.addServiceEventListener(this, null);
|
||||
DsfSession.addSessionEndedListener(new SessionEndedListener() {
|
||||
public void sessionEnded(DsfSession endedSsession) {
|
||||
if (session == endedSsession) {
|
||||
DsfSession.removeSessionEndedListener(this);
|
||||
asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
setDebugContext(null);
|
||||
}});
|
||||
}
|
||||
}});
|
||||
|
||||
updatePC(PC_UNKNOWN);
|
||||
|
||||
if (fGotoAddressPending != PC_UNKNOWN) {
|
||||
|
@ -2399,6 +2395,18 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
|||
firePropertyChange(PROP_SUSPENDED);
|
||||
}
|
||||
|
||||
/*
|
||||
* @see org.eclipse.dd.dsf.service.DsfSession.SessionEndedListener#sessionEnded(org.eclipse.dd.dsf.service.DsfSession)
|
||||
*/
|
||||
public void sessionEnded(DsfSession endedSsession) {
|
||||
if (endedSsession.getId().equals(fDebugSessionId)) {
|
||||
asyncExec(new Runnable() {
|
||||
public void run() {
|
||||
setDebugContext(null);
|
||||
}});
|
||||
}
|
||||
}
|
||||
|
||||
@DsfServiceEventHandler
|
||||
public void handleEvent(IExitedDMEvent event) {
|
||||
if (event.getDMContext().equals(fTargetContext)
|
||||
|
|
Loading…
Add table
Reference in a new issue