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

Bug 334651 - Deadlock reported during startup of cdt.debug.ui

This commit is contained in:
Patrick Chuong 2011-01-18 16:00:51 +00:00
parent 3995cfd1a6
commit a5c5b5ff16

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2004, 2010 QNX Software Systems and others.
* Copyright (c) 2004, 2011 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@ -289,43 +289,48 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
@Override
public void start( BundleContext context ) throws Exception {
super.start( context );
ViewIDCounterManager.getInstance().init();
fDisassemblyEditorManager = new DisassemblyEditorManager();
EvaluationContextManager.startup();
CDebugCorePlugin.getDefault().addCBreakpointListener( CBreakpointUpdater.getInstance() );
// Register the CDI backend for DSF's disassembly view
Platform.getAdapterManager().registerAdapters(new DisassemblyBackendCdiFactory(), ICDebugElement.class);
// We contribute actions to the platform's Variables view with a
// criteria to enable only when this plugin is loaded. This can lead to
// some edge cases with broken behavior (273306). The solution is to
// force a selection change notification after we get loaded.
WorkbenchJob wjob = new WorkbenchJob("CDT Variable view action updater") { //$NON-NLS-1$
WorkbenchJob wjob = new WorkbenchJob("Initializing CDT Debug UI") { //$NON-NLS-1$
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
for (IWorkbenchWindow window : windows) {
IWorkbenchPage[] pages = window.getPages();
for (IWorkbenchPage page : pages) {
IViewReference viewRef = page.findViewReference(IDebugUIConstants.ID_VARIABLE_VIEW);
if (viewRef != null) {
IViewPart part = viewRef.getView(false);
if (part instanceof IDebugView) {
Viewer viewer = ((IDebugView)part).getViewer();
if (viewer != null) {
viewer.setSelection(viewer.getSelection());
}
}
}
}
}
startupInUIThread();
return Status.OK_STATUS;
}
};
wjob.schedule();
}
private void startupInUIThread() {
EvaluationContextManager.startup();
ViewIDCounterManager.getInstance().init();
// We contribute actions to the platform's Variables view with a
// criteria to enable only when this plugin is loaded. This can lead to
// some edge cases with broken behavior (273306). The solution is to
// force a selection change notification after we get loaded.
IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows();
for (IWorkbenchWindow window : windows) {
IWorkbenchPage[] pages = window.getPages();
for (IWorkbenchPage page : pages) {
IViewReference viewRef = page.findViewReference(IDebugUIConstants.ID_VARIABLE_VIEW);
if (viewRef != null) {
IViewPart part = viewRef.getView(false);
if (part instanceof IDebugView) {
Viewer viewer = ((IDebugView)part).getViewer();
if (viewer != null) {
viewer.setSelection(viewer.getSelection());
}
}
}
}
}
}
/*
* (non-Javadoc)
*