diff --git a/plugins/org.eclipse.dd.gdb.launch/META-INF/MANIFEST.MF b/plugins/org.eclipse.dd.gdb.launch/META-INF/MANIFEST.MF index d63b2e1a771..6b7f7e3c17f 100644 --- a/plugins/org.eclipse.dd.gdb.launch/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.dd.gdb.launch/META-INF/MANIFEST.MF @@ -6,15 +6,6 @@ Bundle-SymbolicName: org.eclipse.dd.gdb.launch; singleton:=true Bundle-Version: 1.0.0 Bundle-Activator: org.eclipse.dd.gdb.launch.internal.GdbLaunchPlugin Require-Bundle: org.eclipse.core.runtime, - org.eclipse.dd.dsf, - org.eclipse.dd.dsf.debug, - org.eclipse.dd.mi, - org.eclipse.dd.gdb, - org.eclipse.debug.core, - org.eclipse.cdt.core, - org.eclipse.cdt.launch, - org.eclipse.cdt.debug.core, - org.eclipse.cdt.debug.mi.core + org.eclipse.dd.gdb Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.dd.gdb.launch.launching diff --git a/plugins/org.eclipse.dd.gdb.launch/build.properties b/plugins/org.eclipse.dd.gdb.launch/build.properties index cf2d90c8779..7651071b534 100644 --- a/plugins/org.eclipse.dd.gdb.launch/build.properties +++ b/plugins/org.eclipse.dd.gdb.launch/build.properties @@ -3,5 +3,5 @@ output.. = bin/ bin.includes = plugin.xml,\ META-INF/,\ .,\ - icons/,\ - about.html + about.html,\ + src/ diff --git a/plugins/org.eclipse.dd.gdb.launch/plugin.xml b/plugins/org.eclipse.dd.gdb.launch/plugin.xml index 0b49da90602..d05db8ece4e 100644 --- a/plugins/org.eclipse.dd.gdb.launch/plugin.xml +++ b/plugins/org.eclipse.dd.gdb.launch/plugin.xml @@ -4,7 +4,7 @@ launchShutdownQuery = new Query() { - @Override - protected void execute(DataRequestMonitor rm) { - gdbLaunch.shutdownSession(rm); - } - }; - - try { - gdbLaunch.getSession().getExecutor().execute(launchShutdownQuery); - } catch (RejectedExecutionException e) { - // We can get this exception if the session is shutdown concurrently - // to this method running. - break; - } - - // The Query.get() method is a synchronous call which blocks until the - // query completes. - try { - launchShutdownQuery.get(); - } catch (InterruptedException e) { - getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "InterruptedException while shutting down PDA debugger launch " + gdbLaunch, e.getCause())); //$NON-NLS-1$ - } catch (ExecutionException e) { - getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "Exception while shutting down PDA debugger launch " + gdbLaunch, e.getCause())); //$NON-NLS-1$ - } - } - } - } - + } } diff --git a/plugins/org.eclipse.dd.gdb.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.dd.gdb.ui/META-INF/MANIFEST.MF index 750ac57e684..ab657bc519e 100644 --- a/plugins/org.eclipse.dd.gdb.ui/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.dd.gdb.ui/META-INF/MANIFEST.MF @@ -15,7 +15,6 @@ Require-Bundle: org.eclipse.ui, org.eclipse.dd.mi, org.eclipse.dd.gdb, org.eclipse.dd.dsf.debug, - org.eclipse.cdt.debug.ui, - org.eclipse.dd.gdb.launch + org.eclipse.cdt.debug.ui Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 diff --git a/plugins/org.eclipse.dd.gdb.ui/build.properties b/plugins/org.eclipse.dd.gdb.ui/build.properties index 61543eefe00..91d219bb13a 100644 --- a/plugins/org.eclipse.dd.gdb.ui/build.properties +++ b/plugins/org.eclipse.dd.gdb.ui/build.properties @@ -3,6 +3,5 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ plugin.xml,\ - about.html,\ - icons/ + about.html \ No newline at end of file diff --git a/plugins/org.eclipse.dd.gdb.ui/plugin.xml b/plugins/org.eclipse.dd.gdb.ui/plugin.xml index 7b68df8c943..13ca12a23ec 100644 --- a/plugins/org.eclipse.dd.gdb.ui/plugin.xml +++ b/plugins/org.eclipse.dd.gdb.ui/plugin.xml @@ -7,7 +7,7 @@ + adaptableType="org.eclipse.dd.gdb.launching.GdbLaunch"> diff --git a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/GdbAdapterFactory.java b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/GdbAdapterFactory.java index 0a8e25f346b..1b8e185142d 100644 --- a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/GdbAdapterFactory.java +++ b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/GdbAdapterFactory.java @@ -27,8 +27,8 @@ import org.eclipse.dd.dsf.debug.ui.sourcelookup.MISourceDisplayAdapter; import org.eclipse.dd.dsf.service.DsfSession; import org.eclipse.dd.gdb.internal.ui.actions.DsfTerminateCommand; import org.eclipse.dd.gdb.internal.ui.viewmodel.GdbViewModelAdapter; -import org.eclipse.dd.gdb.launch.launching.GdbLaunch; -import org.eclipse.dd.gdb.launch.launching.GdbLaunchDelegate; +import org.eclipse.dd.gdb.launching.GdbLaunch; +import org.eclipse.dd.gdb.launching.GdbLaunchDelegate; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.ILaunchesListener2; diff --git a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/breakpoints/CBreakpointGdbThreadFilterPage.java b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/breakpoints/CBreakpointGdbThreadFilterPage.java index 994ba97c6e0..bec7fdadec9 100644 --- a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/breakpoints/CBreakpointGdbThreadFilterPage.java +++ b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/breakpoints/CBreakpointGdbThreadFilterPage.java @@ -13,7 +13,7 @@ package org.eclipse.dd.gdb.internal.ui.breakpoints; import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.core.runtime.CoreException; import org.eclipse.dd.gdb.breakpoints.CBreakpointGdbThreadsFilterExtension; -import org.eclipse.dd.gdb.launch.launching.GdbLaunchDelegate; +import org.eclipse.dd.gdb.launching.GdbLaunchDelegate; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; diff --git a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java index 6b963f92b91..957a57bbc08 100644 --- a/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java +++ b/plugins/org.eclipse.dd.gdb.ui/src/org/eclipse/dd/gdb/internal/ui/breakpoints/GdbThreadFilterEditor.java @@ -30,7 +30,7 @@ import org.eclipse.dd.dsf.debug.service.IRunControl.IExecutionDMContext; import org.eclipse.dd.dsf.service.DsfSession; import org.eclipse.dd.gdb.breakpoints.CBreakpointGdbThreadsFilterExtension; import org.eclipse.dd.gdb.internal.ui.GdbUIPlugin; -import org.eclipse.dd.gdb.launch.launching.GdbLaunch; +import org.eclipse.dd.gdb.launching.GdbLaunch; import org.eclipse.dd.gdb.service.GDBRunControl; import org.eclipse.dd.gdb.service.GDBRunControl.GDBThreadData; import org.eclipse.dd.gdb.service.command.GDBControl; diff --git a/plugins/org.eclipse.dd.gdb/META-INF/MANIFEST.MF b/plugins/org.eclipse.dd.gdb/META-INF/MANIFEST.MF index ef35582da38..451260308c2 100644 --- a/plugins/org.eclipse.dd.gdb/META-INF/MANIFEST.MF +++ b/plugins/org.eclipse.dd.gdb/META-INF/MANIFEST.MF @@ -11,10 +11,13 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.dd.mi, org.eclipse.debug.core, org.eclipse.cdt.core, - org.eclipse.cdt.debug.core + org.eclipse.cdt.debug.core, + org.eclipse.cdt.debug.mi.core, + org.eclipse.cdt.launch Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.5 Export-Package: org.eclipse.dd.gdb, org.eclipse.dd.gdb.breakpoints, + org.eclipse.dd.gdb.launching, org.eclipse.dd.gdb.service, org.eclipse.dd.gdb.service.command diff --git a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/GdbPlugin.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/GdbPlugin.java index eabdcb2f9ba..f80e2ae24d3 100644 --- a/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/GdbPlugin.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/internal/GdbPlugin.java @@ -1,6 +1,16 @@ package org.eclipse.dd.gdb.internal; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.RejectedExecutionException; + +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; +import org.eclipse.dd.dsf.concurrent.DataRequestMonitor; +import org.eclipse.dd.dsf.concurrent.Query; +import org.eclipse.dd.gdb.launching.GdbLaunch; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunch; import org.osgi.framework.BundleContext; /** @@ -39,6 +49,7 @@ public class GdbPlugin extends Plugin { */ @Override public void stop(BundleContext context) throws Exception { + shutdownActiveLaunches(); plugin = null; super.stop(context); fgBundleContext = null; @@ -56,4 +67,42 @@ public class GdbPlugin extends Plugin { public static BundleContext getBundleContext() { return fgBundleContext; } + /** + * Shuts down any active launches. We must shutdown any active sessions + * and services associated with this plugin before this plugin is stopped. + * Any attempts to use the plugins {@link BundleContext} after the plugin + * is shut down will result in exceptions. + */ + private void shutdownActiveLaunches() { + for (ILaunch launch : DebugPlugin.getDefault().getLaunchManager().getLaunches()) { + if (launch instanceof GdbLaunch && ((GdbLaunch)launch).getSession().isActive()) { + final GdbLaunch gdbLaunch = (GdbLaunch)launch; + + Query launchShutdownQuery = new Query() { + @Override + protected void execute(DataRequestMonitor rm) { + gdbLaunch.shutdownSession(rm); + } + }; + + try { + gdbLaunch.getSession().getExecutor().execute(launchShutdownQuery); + } catch (RejectedExecutionException e) { + // We can get this exception if the session is shutdown concurrently + // to this method running. + break; + } + + // The Query.get() method is a synchronous call which blocks until the + // query completes. + try { + launchShutdownQuery.get(); + } catch (InterruptedException e) { + getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "InterruptedException while shutting down PDA debugger launch " + gdbLaunch, e.getCause())); //$NON-NLS-1$ + } catch (ExecutionException e) { + getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, "Exception while shutting down PDA debugger launch " + gdbLaunch, e.getCause())); //$NON-NLS-1$ + } + } + } + } } diff --git a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/FinalLaunchSequence.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/FinalLaunchSequence.java similarity index 89% rename from plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/FinalLaunchSequence.java rename to plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/FinalLaunchSequence.java index 1533ada87bc..553809daa2a 100644 --- a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/FinalLaunchSequence.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/FinalLaunchSequence.java @@ -8,7 +8,7 @@ * Contributors: * Ericsson - initial API and implementation *******************************************************************************/ -package org.eclipse.dd.gdb.launch.launching; +package org.eclipse.dd.gdb.launching; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.cdt.debug.internal.core.sourcelookup.CSourceLookupDirector; @@ -23,7 +23,7 @@ import org.eclipse.dd.dsf.concurrent.Sequence; import org.eclipse.dd.dsf.debug.service.IBreakpoints.IBreakpointsTargetDMContext; import org.eclipse.dd.dsf.debug.service.IRunControl.IContainerDMContext; import org.eclipse.dd.dsf.service.DsfServicesTracker; -import org.eclipse.dd.gdb.launch.internal.GdbLaunchPlugin; +import org.eclipse.dd.gdb.internal.GdbPlugin; import org.eclipse.dd.gdb.service.command.GDBControl; import org.eclipse.dd.gdb.service.command.GDBControl.SessionType; import org.eclipse.dd.mi.service.CSourceLookup; @@ -45,7 +45,7 @@ public class FinalLaunchSequence extends Sequence { */ new Step() { @Override public void execute(RequestMonitor requestMonitor) { - DsfServicesTracker tracker = new DsfServicesTracker(GdbLaunchPlugin.getBundleContext(), fLaunch.getSession().getId()); + DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fLaunch.getSession().getId()); fCommandControl = tracker.getService(GDBControl.class); tracker.dispose(); @@ -56,7 +56,7 @@ public class FinalLaunchSequence extends Sequence { */ new Step() { @Override public void execute(RequestMonitor requestMonitor) { - DsfServicesTracker tracker = new DsfServicesTracker(GdbLaunchPlugin.getBundleContext(), fLaunch.getSession().getId()); + DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fLaunch.getSession().getId()); CSourceLookup sourceLookup = tracker.getService(CSourceLookup.class); tracker.dispose(); @@ -79,7 +79,7 @@ public class FinalLaunchSequence extends Sequence { IGDBServerMILaunchConfigurationConstants.ATTR_REMOTE_TCP, false); } catch (CoreException e) { - requestMonitor.setStatus(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, -1, "Cannot retrieve connection mode", e)); //$NON-NLS-1$ + requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot retrieve connection mode", e)); //$NON-NLS-1$ requestMonitor.done(); return false; } @@ -89,9 +89,9 @@ public class FinalLaunchSequence extends Sequence { private boolean getSerialDevice(RequestMonitor requestMonitor) { try { fSerialDevice = fLaunch.getLaunchConfiguration().getAttribute( - IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); + IGDBServerMILaunchConfigurationConstants.ATTR_DEV, "invalid"); //$NON-NLS-1$ } catch (CoreException e) { - requestMonitor.setStatus(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, -1, "Cannot retrieve serial device", e)); //$NON-NLS-1$ + requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot retrieve serial device", e)); //$NON-NLS-1$ requestMonitor.done(); return false; } @@ -101,9 +101,9 @@ public class FinalLaunchSequence extends Sequence { private boolean getTcpHost(RequestMonitor requestMonitor) { try { fRemoteTcpHost = fLaunch.getLaunchConfiguration().getAttribute( - IGDBServerMILaunchConfigurationConstants.ATTR_HOST, "invalid"); + IGDBServerMILaunchConfigurationConstants.ATTR_HOST, "invalid"); //$NON-NLS-1$ } catch (CoreException e) { - requestMonitor.setStatus(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, -1, "Cannot retrieve remote TCP host", e)); //$NON-NLS-1$ + requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot retrieve remote TCP host", e)); //$NON-NLS-1$ requestMonitor.done(); return false; } @@ -113,9 +113,9 @@ public class FinalLaunchSequence extends Sequence { private boolean getTcpPort(RequestMonitor requestMonitor) { try { fRemoteTcpPort = fLaunch.getLaunchConfiguration().getAttribute( - IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid"); + IGDBServerMILaunchConfigurationConstants.ATTR_PORT, "invalid"); //$NON-NLS-1$ } catch (CoreException e) { - requestMonitor.setStatus(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, -1, "Cannot retrieve remote TCP port", e)); //$NON-NLS-1$ + requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot retrieve remote TCP port", e)); //$NON-NLS-1$ requestMonitor.done(); return false; } @@ -132,14 +132,14 @@ public class FinalLaunchSequence extends Sequence { if (!getTcpPort(requestMonitor)) return; fCommandControl.queueCommand( - new MITargetSelect((IContainerDMContext)fCommandControl.getControlDMContext(), - fRemoteTcpHost, fRemoteTcpPort), + new MITargetSelect(fCommandControl.getControlDMContext(), + fRemoteTcpHost, fRemoteTcpPort), new DataRequestMonitor(getExecutor(), requestMonitor)); } else { if (!getSerialDevice(requestMonitor)) return; fCommandControl.queueCommand( - new MITargetSelect((IContainerDMContext)fCommandControl.getControlDMContext(), + new MITargetSelect(fCommandControl.getControlDMContext(), fSerialDevice), new DataRequestMonitor(getExecutor(), requestMonitor)); } @@ -154,7 +154,7 @@ public class FinalLaunchSequence extends Sequence { */ new Step() { @Override public void execute(final RequestMonitor requestMonitor) { - DsfServicesTracker tracker = new DsfServicesTracker(GdbLaunchPlugin.getBundleContext(), fLaunch.getSession().getId()); + DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fLaunch.getSession().getId()); MIBreakpointsManager bpmService = tracker.getService(MIBreakpointsManager.class); tracker.dispose(); bpmService.startTrackingBreakpoints(fCommandControl.getGDBDMContext(), requestMonitor); @@ -174,7 +174,7 @@ public class FinalLaunchSequence extends Sequence { try { fStopInMain = fLaunch.getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false ); } catch (CoreException e) { - requestMonitor.setStatus(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, -1, "Cannot retrieve the entry point symbol", e)); //$NON-NLS-1$ + requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, -1, "Cannot retrieve the entry point symbol", e)); //$NON-NLS-1$ requestMonitor.done(); return false; } @@ -185,7 +185,7 @@ public class FinalLaunchSequence extends Sequence { try { fStopSymbol = fLaunch.getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN_SYMBOL, ICDTLaunchConfigurationConstants.DEBUGGER_STOP_AT_MAIN_SYMBOL_DEFAULT ); } catch (CoreException e) { - requestMonitor.setStatus(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, DebugException.CONFIGURATION_INVALID, "Cannot retrieve the entry point symbol", e)); //$NON-NLS-1$ + requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.CONFIGURATION_INVALID, "Cannot retrieve the entry point symbol", e)); //$NON-NLS-1$ requestMonitor.done(); return false; } diff --git a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/GdbLaunch.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/GdbLaunch.java similarity index 89% rename from plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/GdbLaunch.java rename to plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/GdbLaunch.java index f9a6f5f97e7..f723d05eeb1 100644 --- a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/GdbLaunch.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/GdbLaunch.java @@ -8,7 +8,7 @@ * Contributors: * Wind River Systems - initial API and implementation *******************************************************************************/ -package org.eclipse.dd.gdb.launch.launching; +package org.eclipse.dd.gdb.launching; import java.util.concurrent.ExecutionException; @@ -29,7 +29,7 @@ import org.eclipse.dd.dsf.concurrent.ThreadSafe; import org.eclipse.dd.dsf.service.DsfServiceEventHandler; import org.eclipse.dd.dsf.service.DsfServicesTracker; import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.gdb.launch.internal.GdbLaunchPlugin; +import org.eclipse.dd.gdb.internal.GdbPlugin; import org.eclipse.dd.gdb.service.command.GDBControl; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.ILaunchConfiguration; @@ -71,7 +71,7 @@ public class GdbLaunch extends Launch Runnable initRunnable = new DsfRunnable() { public void run() { - fTracker = new DsfServicesTracker(GdbLaunchPlugin.getBundleContext(), fSession.getId()); + fTracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fSession.getId()); fSession.addServiceEventListener(GdbLaunch.this, null); fInitialized = true; @@ -83,9 +83,9 @@ public class GdbLaunch extends Launch try { fExecutor.submit(initRunnable).get(); } catch (InterruptedException e) { - new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Error initializing launch", e); //$NON-NLS-1$ + new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Error initializing launch", e); //$NON-NLS-1$ } catch (ExecutionException e) { - new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Error initializing launch", e); //$NON-NLS-1$ + new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Error initializing launch", e); //$NON-NLS-1$ } } @@ -145,8 +145,8 @@ public class GdbLaunch extends Launch public void handleCompleted() { fSession.removeServiceEventListener(GdbLaunch.this); if (!isSuccess()) { - GdbLaunchPlugin.getDefault().getLog().log(new MultiStatus( - GdbLaunchPlugin.PLUGIN_ID, -1, new IStatus[]{getStatus()}, "Session shutdown failed", null)); //$NON-NLS-1$ + GdbPlugin.getDefault().getLog().log(new MultiStatus( + GdbPlugin.PLUGIN_ID, -1, new IStatus[]{getStatus()}, "Session shutdown failed", null)); //$NON-NLS-1$ } // Last order of business, shutdown the dispatch queue. fTracker.dispose(); diff --git a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/GdbLaunchDelegate.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/GdbLaunchDelegate.java similarity index 92% rename from plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/GdbLaunchDelegate.java rename to plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/GdbLaunchDelegate.java index 7dce245a668..8a270f780fd 100644 --- a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/GdbLaunchDelegate.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/GdbLaunchDelegate.java @@ -8,7 +8,7 @@ * Contributors: * QNX Software Systems - Initial API and implementation *******************************************************************************/ -package org.eclipse.dd.gdb.launch.launching; +package org.eclipse.dd.gdb.launching; import java.io.File; import java.io.IOException; @@ -35,7 +35,7 @@ import org.eclipse.dd.dsf.debug.model.DsfMemoryBlockRetrieval; import org.eclipse.dd.dsf.debug.service.IMemory.IMemoryDMContext; import org.eclipse.dd.dsf.service.DsfServicesTracker; import org.eclipse.dd.gdb.IGDBLaunchConfigurationConstants; -import org.eclipse.dd.gdb.launch.internal.GdbLaunchPlugin; +import org.eclipse.dd.gdb.internal.GdbPlugin; import org.eclipse.dd.gdb.service.command.GDBControl; import org.eclipse.dd.gdb.service.command.GDBControl.SessionType; import org.eclipse.dd.mi.service.command.AbstractCLIProcess; @@ -131,9 +131,9 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate try { servicesLaunchSequence.get(); } catch (InterruptedException e1) { - throw new DebugException(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Interrupted Exception in dispatch thread", e1)); //$NON-NLS-1$ + throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Interrupted Exception in dispatch thread", e1)); //$NON-NLS-1$ } catch (ExecutionException e1) { - throw new DebugException(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in services launch sequence", e1.getCause())); //$NON-NLS-1$ + throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in services launch sequence", e1.getCause())); //$NON-NLS-1$ } launch.initializeControl(); @@ -144,7 +144,7 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate try { launch.getDsfExecutor().submit( new Callable() { public Object call() throws CoreException { - DsfServicesTracker tracker = new DsfServicesTracker(GdbLaunchPlugin.getBundleContext(), launch.getSession().getId()); + DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), launch.getSession().getId()); GDBControl gdb = tracker.getService(GDBControl.class); if (gdb != null) { cliProcessRef.set(gdb.getCLIProcess()); @@ -157,11 +157,11 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate launch.addProcess(DebugPlugin.newProcess(launch, cliProcessRef.get(), "gdb")); //$NON-NLS-1$ launch.addProcess(DebugPlugin.newProcess(launch, inferiorProcessRef.get(), exePath.lastSegment())); } catch (InterruptedException e) { - throw new CoreException(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, 0, "Interrupted while waiting for get process callable.", e)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, 0, "Interrupted while waiting for get process callable.", e)); //$NON-NLS-1$ } catch (ExecutionException e) { throw (CoreException)e.getCause(); } catch (RejectedExecutionException e) { - throw new CoreException(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, 0, "Debugger shut down before launch was completed.", e)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, 0, "Debugger shut down before launch was completed.", e)); //$NON-NLS-1$ } // Create and invoke the final launch sequence to setup GDB @@ -171,15 +171,15 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate try { finalLaunchSequence.get(); } catch (InterruptedException e1) { - throw new DebugException(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Interrupted Exception in dispatch thread", e1)); //$NON-NLS-1$ + throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.INTERNAL_ERROR, "Interrupted Exception in dispatch thread", e1)); //$NON-NLS-1$ } catch (ExecutionException e1) { - throw new DebugException(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in final launch sequence", e1.getCause())); //$NON-NLS-1$ + throw new DebugException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, "Error in final launch sequence", e1.getCause())); //$NON-NLS-1$ } // Create a memory retrieval and register it with session try { launch.getDsfExecutor().submit( new Callable() { public Object call() throws CoreException { - DsfServicesTracker tracker = new DsfServicesTracker(GdbLaunchPlugin.getBundleContext(), launch.getSession().getId()); + DsfServicesTracker tracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), launch.getSession().getId()); GDBControl gdbControl = tracker.getService(GDBControl.class); if (gdbControl != null) { IMemoryBlockRetrieval memRetrieval = new DsfMemoryBlockRetrieval( @@ -192,11 +192,11 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate } }).get(); } catch (InterruptedException e) { - throw new CoreException(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, 0, "Interrupted while waiting for get process callable.", e)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, 0, "Interrupted while waiting for get process callable.", e)); //$NON-NLS-1$ } catch (ExecutionException e) { throw (CoreException)e.getCause(); } catch (RejectedExecutionException e) { - throw new CoreException(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, 0, "Debugger shut down before launch was completed.", e)); //$NON-NLS-1$ + throw new CoreException(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, 0, "Debugger shut down before launch was completed.", e)); //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/ServicesLaunchSequence.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/ServicesLaunchSequence.java similarity index 99% rename from plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/ServicesLaunchSequence.java rename to plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/ServicesLaunchSequence.java index 62ef5d4c0d7..4b87b6b8400 100644 --- a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/ServicesLaunchSequence.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/ServicesLaunchSequence.java @@ -8,7 +8,7 @@ * Contributors: * Wind River Systems - initial API and implementation *******************************************************************************/ -package org.eclipse.dd.gdb.launch.launching; +package org.eclipse.dd.gdb.launching; import org.eclipse.cdt.debug.core.CDebugCorePlugin; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; diff --git a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/ShutdownSequence.java b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/ShutdownSequence.java similarity index 92% rename from plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/ShutdownSequence.java rename to plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/ShutdownSequence.java index 08177c352c5..3afdd49c864 100644 --- a/plugins/org.eclipse.dd.gdb.launch/src/org/eclipse/dd/gdb/launch/launching/ShutdownSequence.java +++ b/plugins/org.eclipse.dd.gdb/src/org/eclipse/dd/gdb/launching/ShutdownSequence.java @@ -8,7 +8,7 @@ * Contributors: * Wind River Systems - initial API and implementation *******************************************************************************/ -package org.eclipse.dd.gdb.launch.launching; +package org.eclipse.dd.gdb.launching; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; @@ -18,7 +18,7 @@ import org.eclipse.dd.dsf.concurrent.RequestMonitor; import org.eclipse.dd.dsf.concurrent.Sequence; import org.eclipse.dd.dsf.service.DsfServicesTracker; import org.eclipse.dd.dsf.service.IDsfService; -import org.eclipse.dd.gdb.launch.internal.GdbLaunchPlugin; +import org.eclipse.dd.gdb.internal.GdbPlugin; import org.eclipse.dd.gdb.service.GDBRunControl; import org.eclipse.dd.gdb.service.command.GDBControl; import org.eclipse.dd.mi.service.CSourceLookup; @@ -54,8 +54,8 @@ public class ShutdownSequence extends Sequence { private final Step[] fSteps = new Step[] { new Step() { @Override public void execute(RequestMonitor requestMonitor) { - assert GdbLaunchPlugin.getBundleContext() != null; - fTracker = new DsfServicesTracker(GdbLaunchPlugin.getBundleContext(), fSessionId); + assert GdbPlugin.getBundleContext() != null; + fTracker = new DsfServicesTracker(GdbPlugin.getBundleContext(), fSessionId); requestMonitor.done(); } @@ -93,13 +93,13 @@ public class ShutdownSequence extends Sequence { // protected void handleCompleted() { // // If un-installing breakpoints fails, log the error but continue shutting down. // if (!isSuccess) { -// DsfGdbLaunchPlugin.getDefault().getLog().log(getStatus()); +// DsfGdbPlugin.getDefault().getLog().log(getStatus()); // } // requestMonitor.done(); // } // }); // } else { -// requestMonitor.setStatus(new Status(IStatus.ERROR, DsfGdbLaunchPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, +// requestMonitor.setStatus(new Status(IStatus.ERROR, DsfGdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, // "Needed services not found.", null)); //$NON-NLS-1$ // requestMonitor.done(); // } @@ -166,13 +166,13 @@ public class ShutdownSequence extends Sequence { @Override protected void handleCompleted() { if (!isSuccess()) { - GdbLaunchPlugin.getDefault().getLog().log(getStatus()); + GdbPlugin.getDefault().getLog().log(getStatus()); } requestMonitor.done(); } }); } else { - requestMonitor.setStatus(new Status(IStatus.ERROR, GdbLaunchPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, + requestMonitor.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INTERNAL_ERROR, "Service '" + clazz.getName() + "' not found.", null)); //$NON-NLS-1$//$NON-NLS-2$ requestMonitor.done(); } diff --git a/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/framework/BaseTestCase.java b/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/framework/BaseTestCase.java index 15b239a6185..7e86c586dec 100644 --- a/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/framework/BaseTestCase.java +++ b/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/framework/BaseTestCase.java @@ -15,7 +15,7 @@ import java.util.Map; import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.dd.gdb.launch.launching.GdbLaunch; +import org.eclipse.dd.gdb.launching.GdbLaunch; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationType; diff --git a/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/launching/LaunchSequence.java b/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/launching/LaunchSequence.java index f8e52ac6fc2..ba0357795b6 100644 --- a/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/launching/LaunchSequence.java +++ b/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/launching/LaunchSequence.java @@ -27,7 +27,7 @@ import org.eclipse.dd.dsf.concurrent.Sequence; import org.eclipse.dd.dsf.debug.service.StepQueueManager; import org.eclipse.dd.dsf.service.DsfServiceEventHandler; import org.eclipse.dd.dsf.service.DsfSession; -import org.eclipse.dd.gdb.launch.launching.GdbLaunch; +import org.eclipse.dd.gdb.launching.GdbLaunch; import org.eclipse.dd.gdb.service.GDBRunControl; import org.eclipse.dd.gdb.service.command.GDBControl; import org.eclipse.dd.mi.service.CSourceLookup; diff --git a/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/launching/TestLaunchDelegate.java b/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/launching/TestLaunchDelegate.java index eb011ac3cf2..114ee8324c7 100644 --- a/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/launching/TestLaunchDelegate.java +++ b/plugins/org.eclipse.dd.tests.gdb/src/org/eclipse/dd/tests/gdb/launching/TestLaunchDelegate.java @@ -35,7 +35,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.dd.dsf.concurrent.ThreadSafe; import org.eclipse.dd.dsf.debug.model.DsfMemoryBlockRetrieval; import org.eclipse.dd.dsf.service.DsfServicesTracker; -import org.eclipse.dd.gdb.launch.launching.GdbLaunch; +import org.eclipse.dd.gdb.launching.GdbLaunch; import org.eclipse.dd.gdb.service.command.GDBControl; import org.eclipse.dd.mi.service.command.AbstractCLIProcess; import org.eclipse.dd.mi.service.command.MIInferiorProcess;