mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 221505
The point of having an org.eclipse.dd.gdb.launch plugin was to allow other people to ignore this plugin and not have the standard DSF launches appear. However, the DSF launch classes can still be useful to those people as they can be extended. Therefore, the launch code should not be in org.eclipse.dd.gdb.launch, but put back in org.ecipse.dd.gdb
This commit is contained in:
parent
9fd5e0d9eb
commit
89c5e765ba
20 changed files with 114 additions and 124 deletions
|
@ -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
|
||||
|
|
|
@ -3,5 +3,5 @@ output.. = bin/
|
|||
bin.includes = plugin.xml,\
|
||||
META-INF/,\
|
||||
.,\
|
||||
icons/,\
|
||||
about.html
|
||||
about.html,\
|
||||
src/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<extension point="org.eclipse.debug.core.launchConfigurationTypes">
|
||||
<launchConfigurationType
|
||||
sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
|
||||
delegate="org.eclipse.dd.gdb.launch.launching.GdbLaunchDelegate"
|
||||
delegate="org.eclipse.dd.gdb.launching.GdbLaunchDelegate"
|
||||
public="true"
|
||||
sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
|
||||
name="Local C/C++ Application (Experimental - DSF)"
|
||||
|
@ -12,7 +12,7 @@
|
|||
modes="debug">
|
||||
</launchConfigurationType>
|
||||
<launchConfigurationType
|
||||
delegate="org.eclipse.dd.gdb.launch.launching.GdbLaunchDelegate"
|
||||
delegate="org.eclipse.dd.gdb.launching.GdbLaunchDelegate"
|
||||
id="org.eclipse.dd.gdb.launch.remoteCLaunch"
|
||||
modes="debug"
|
||||
name="Remote C/C++ Application (Experimental - DSF)"
|
||||
|
|
|
@ -10,17 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.dd.gdb.launch.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.launch.launching.GdbLaunch;
|
||||
import org.eclipse.debug.core.DebugPlugin;
|
||||
import org.eclipse.debug.core.ILaunch;
|
||||
import org.osgi.framework.BundleContext;
|
||||
|
||||
/**
|
||||
|
@ -59,7 +49,6 @@ public class GdbLaunchPlugin extends Plugin {
|
|||
*/
|
||||
@Override
|
||||
public void stop(BundleContext context) throws Exception {
|
||||
shutdownActiveLaunches();
|
||||
plugin = null;
|
||||
super.stop(context);
|
||||
fgBundleContext = null;
|
||||
|
@ -76,45 +65,5 @@ public class GdbLaunchPlugin 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<Object> launchShutdownQuery = new Query<Object>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<Object> 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$
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,6 +3,5 @@ output.. = bin/
|
|||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml,\
|
||||
about.html,\
|
||||
icons/
|
||||
about.html
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
<extension point="org.eclipse.core.runtime.adapters">
|
||||
<factory
|
||||
class="org.eclipse.dd.gdb.internal.ui.GdbAdapterFactory"
|
||||
adaptableType="org.eclipse.dd.gdb.launch.launching.GdbLaunch">
|
||||
adaptableType="org.eclipse.dd.gdb.launching.GdbLaunch">
|
||||
<adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider"/>
|
||||
<adapter type="org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxyFactory"/>
|
||||
<adapter type="org.eclipse.debug.ui.contexts.ISuspendTrigger"/>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<Object> launchShutdownQuery = new Query<Object>() {
|
||||
@Override
|
||||
protected void execute(DataRequestMonitor<Object> 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$
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<MIInfo>(getExecutor(), requestMonitor));
|
||||
} else {
|
||||
if (!getSerialDevice(requestMonitor)) return;
|
||||
|
||||
fCommandControl.queueCommand(
|
||||
new MITargetSelect((IContainerDMContext)fCommandControl.getControlDMContext(),
|
||||
new MITargetSelect(fCommandControl.getControlDMContext(),
|
||||
fSerialDevice),
|
||||
new DataRequestMonitor<MIInfo>(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;
|
||||
}
|
|
@ -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();
|
|
@ -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<Object>() {
|
||||
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<Object>() {
|
||||
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$
|
||||
}
|
||||
}
|
||||
|
|
@ -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;
|
|
@ -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();
|
||||
}
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue