Bug 573696: add dummy listener to DebugPlugin

Change-Id: Ic8603d82dd9aaeaec845a9ca33ee715b63a901fd
Signed-off-by: Anton Backstrom <anton.backstrom@gaisler.com>
This commit is contained in:
Anton Backstrom 2021-05-25 16:44:48 +02:00
parent 7e134ccf24
commit 01cc2ac4d2

View file

@ -40,6 +40,9 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.IDebugEventSetListener;
import org.eclipse.debug.core.model.IPersistableSourceLocator;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.IDebugView;
@ -91,6 +94,19 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
private static IDebuggerConsoleManager fDebuggerConsoleManager;
/**
* At least one listener must be registered on the DebugPlugin in order
* for certain actions, like RunToLine, to work. See bug 573696.
*/
private static class DebugListener implements IDebugEventSetListener {
@Override
public void handleDebugEvents(DebugEvent[] arg0) {
/* Do nothing, see bug 573696*/
}
}
private static DebugListener dummy = new DebugListener();
/**
* The constructor.
*/
@ -294,6 +310,9 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
fDisassemblyEditorManager = new DisassemblyEditorManager();
CDebugCorePlugin.getDefault().addCBreakpointListener(CBreakpointUpdater.getInstance());
// See bug 573696
DebugPlugin.getDefault().addDebugEventListener(dummy);
fDebuggerConsoleManager = new DebuggerConsoleManager();
WorkbenchJob wjob = new WorkbenchJob("Initializing CDT Debug UI") { //$NON-NLS-1$
@ -335,6 +354,10 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
public void stop(BundleContext context) throws Exception {
CDebugCorePlugin.getDefault().removeCBreakpointListener(CBreakpointUpdater.getInstance());
fDisassemblyEditorManager.dispose();
// See bug 573696
DebugPlugin.getDefault().removeDebugEventListener(dummy);
if (fImageDescriptorRegistry != null) {
fImageDescriptorRegistry.dispose();
}