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
|
* DisassemblyPart
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("restriction")
|
@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();
|
private final static boolean DEBUG = DsfDebugUIPlugin.getDefault().isDebugging();
|
||||||
|
|
||||||
|
@ -794,6 +794,7 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
} else {
|
} else {
|
||||||
updateDebugContext();
|
updateDebugContext();
|
||||||
}
|
}
|
||||||
|
DsfSession.addSessionEndedListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -828,12 +829,9 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
ctxService.deactivateContext(fContextActivation);
|
ctxService.deactivateContext(fContextActivation);
|
||||||
}
|
}
|
||||||
fViewer = null;
|
fViewer = null;
|
||||||
fDebugSessionId = null;
|
setDebugContext(null);
|
||||||
fTargetContext= null;
|
DsfSession.removeSessionEndedListener(this);
|
||||||
if (fServicesTracker != null) {
|
|
||||||
fServicesTracker.dispose();
|
|
||||||
fServicesTracker= null;
|
|
||||||
}
|
|
||||||
fAnnotationAccess = null;
|
fAnnotationAccess = null;
|
||||||
fAnnotationPreferences = null;
|
fAnnotationPreferences = null;
|
||||||
fAnnotationRulerColumn = null;
|
fAnnotationRulerColumn = null;
|
||||||
|
@ -2323,12 +2321,17 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fTargetContext != null) {
|
if (fTargetContext != null) {
|
||||||
|
if (fDebugSessionId != null) {
|
||||||
|
if (getSession() != null) {
|
||||||
|
getSession().removeServiceEventListener(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
fDebugSessionId= sessionId;
|
fDebugSessionId= sessionId;
|
||||||
if (fServicesTracker != null) {
|
if (fServicesTracker != null) {
|
||||||
fServicesTracker.dispose();
|
fServicesTracker.dispose();
|
||||||
}
|
}
|
||||||
fServicesTracker = new DsfServicesTracker(DsfDebugUIPlugin.getBundleContext(), sessionId);
|
fServicesTracker = new DsfServicesTracker(DsfDebugUIPlugin.getBundleContext(), sessionId);
|
||||||
if (fViewer != null) {
|
if (fViewer != null) {
|
||||||
debugContextChanged();
|
debugContextChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2351,6 +2354,10 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
}
|
}
|
||||||
fDebugSessionId= null;
|
fDebugSessionId= null;
|
||||||
fTargetContext= null;
|
fTargetContext= null;
|
||||||
|
if (fServicesTracker != null) {
|
||||||
|
fServicesTracker.dispose();
|
||||||
|
fServicesTracker= null;
|
||||||
|
}
|
||||||
if (fViewer != null) {
|
if (fViewer != null) {
|
||||||
debugContextChanged();
|
debugContextChanged();
|
||||||
}
|
}
|
||||||
|
@ -2365,17 +2372,6 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
if (fDebugSessionId != null) {
|
if (fDebugSessionId != null) {
|
||||||
final DsfSession session= getSession();
|
final DsfSession session= getSession();
|
||||||
session.addServiceEventListener(this, null);
|
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);
|
updatePC(PC_UNKNOWN);
|
||||||
|
|
||||||
if (fGotoAddressPending != PC_UNKNOWN) {
|
if (fGotoAddressPending != PC_UNKNOWN) {
|
||||||
|
@ -2399,6 +2395,18 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
|
||||||
firePropertyChange(PROP_SUSPENDED);
|
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
|
@DsfServiceEventHandler
|
||||||
public void handleEvent(IExitedDMEvent event) {
|
public void handleEvent(IExitedDMEvent event) {
|
||||||
if (event.getDMContext().equals(fTargetContext)
|
if (event.getDMContext().equals(fTargetContext)
|
||||||
|
|
Loading…
Add table
Reference in a new issue