1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Disassembly view should blank out if there is no debug context, related to bug 337376

This commit is contained in:
Anton Leherbauer 2011-03-11 08:34:25 +00:00
parent 63ec2d8b00
commit 91c51e5113

View file

@ -1847,43 +1847,46 @@ public abstract class DisassemblyPart extends WorkbenchPart implements IDisassem
protected void updateDebugContext() { protected void updateDebugContext() {
IAdaptable context = DebugUITools.getPartDebugContext(getSite()); IAdaptable context = DebugUITools.getPartDebugContext(getSite());
IDisassemblyBackend prevBackend = fBackend;
IDisassemblyBackend newBackend = null;
fDebugSessionId = null;
boolean needUpdate = false;
if (context != null) { if (context != null) {
final IDisassemblyBackend prevBackend = fBackend; if (prevBackend != null && prevBackend.supportsDebugContext(context)) {
fDebugSessionId = null; newBackend = prevBackend;
boolean needUpdate = false; } else {
if (prevBackend == null || !prevBackend.supportsDebugContext(context)) {
needUpdate = true; needUpdate = true;
fBackend = (IDisassemblyBackend)context.getAdapter(IDisassemblyBackend.class); newBackend = (IDisassemblyBackend)context.getAdapter(IDisassemblyBackend.class);
if (fBackend != null) { if (newBackend != null) {
if (fBackend.supportsDebugContext(context)) { if (newBackend.supportsDebugContext(context)) {
fBackend.init(this); newBackend.init(this);
} else { } else {
fBackend = null; newBackend = null;
} }
} }
} }
}
if (fBackend != null) { fBackend = newBackend;
IDisassemblyBackend.SetDebugContextResult result = fBackend.setDebugContext(context); if (newBackend != null) {
if (result != null) { IDisassemblyBackend.SetDebugContextResult result = newBackend.setDebugContext(context);
fDebugSessionId = result.sessionId; if (result != null) {
if (result.contextChanged) { fDebugSessionId = result.sessionId;
needUpdate = true; if (result.contextChanged) {
} needUpdate = true;
} }
} }
if (prevBackend != null && fBackend != prevBackend) { }
needUpdate = true; if (prevBackend != null && newBackend != prevBackend) {
prevBackend.clearDebugContext(); needUpdate = true;
prevBackend.dispose(); prevBackend.clearDebugContext();
} prevBackend.dispose();
if (needUpdate && fViewer != null) { }
startUpdate(new Runnable() { if (needUpdate && fViewer != null) {
public void run() { startUpdate(new Runnable() {
debugContextChanged(); public void run() {
} debugContextChanged();
}); }
} });
} }
} }