Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2002-04-04 17:06:38 -0500
committerDarin Swanson2002-04-04 17:06:38 -0500
commitf122ade16dfc3f99a2fb7bde09e0463c4f67100b (patch)
tree2185a54f977c2d5f31996d1ba32765fa64dfe104 /org.eclipse.debug.core
parent9baee023e2ae7ed0bdd5b901b8b2c3aedb63a087 (diff)
downloadeclipse.platform.debug-f122ade16dfc3f99a2fb7bde09e0463c4f67100b.tar.gz
eclipse.platform.debug-f122ade16dfc3f99a2fb7bde09e0463c4f67100b.tar.xz
eclipse.platform.debug-f122ade16dfc3f99a2fb7bde09e0463c4f67100b.zip
Bug 12160 - Launch creation/lifecycle
Diffstat (limited to 'org.eclipse.debug.core')
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java22
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java14
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java2
-rw-r--r--org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java19
4 files changed, 33 insertions, 24 deletions
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
index 5ac879cf6..e29de0941 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/Launch.java
@@ -125,6 +125,7 @@ public class Launch extends PlatformObject implements ILaunch {
* or <code>null</code> if none
* @param target the debug target created by this launch, or <code>null</code>
* if none
+ * @deprecated to be removed
*/
public Launch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator, IProcess[] processes, IDebugTarget target) {
setLauncher(null);
@@ -137,6 +138,23 @@ public class Launch extends PlatformObject implements ILaunch {
}
/**
+ * Constructs a launch with the specified attributes.
+ *
+ * @param launchConfiguration the configuration that was launched
+ * @param mode the mode of this launch - run or debug (constants
+ * defined by <code>ILaunchManager</code>)
+ * @param locator the source locator to use for this debug session, or
+ * <code>null</code> if not supported
+ */
+ public Launch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
+ setLauncher(null);
+ setElement(launchConfiguration);
+ setSourceLocator(locator);
+ setLaunchMode(mode);
+ fSuppressChange = false;
+ }
+
+ /**
* @see org.eclipse.debug.core.model.ITerminate#canTerminate()
*/
public final boolean canTerminate() {
@@ -207,7 +225,7 @@ public class Launch extends PlatformObject implements ILaunch {
* Returns the processes associated with this
* launch, in its internal form - a list.
*
- * @return list or processes
+ * @return list of processes
*/
protected List getProcesses0() {
return fProcesses;
@@ -421,7 +439,7 @@ public class Launch extends PlatformObject implements ILaunch {
}
/**
- * Adds the given processes to this lanuch.
+ * Adds the given processes to this launch.
*
* @param processes processes to add
*/
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java
index 40c57798b..6d3362fa8 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/core/model/IProcess.java
@@ -5,8 +5,8 @@ package org.eclipse.debug.core.model;
* All Rights Reserved.
*/
-import org.eclipse.debug.core.ILaunch;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.debug.core.ILaunch;
/**
* A process represents a program running in normal (non-debug) mode.
@@ -19,7 +19,7 @@ import org.eclipse.core.runtime.IAdaptable;
* provides an implementation of this interface for a
* <code>java.lang.Process</code>.
* </p>
- * @see org.eclipse.debug.core.DebugPlugin#newProcess(Process, String)
+ * @see org.eclipse.debug.core.DebugPlugin#newProcess(ILaunch, Process, String)
*/
public interface IProcess extends IAdaptable, ITerminate {
@@ -30,12 +30,7 @@ public interface IProcess extends IAdaptable, ITerminate {
*/
public String getLabel();
/**
- * Returns the launch this element originated from, or
- * <code>null</code> if this element is not registered with
- * an launch. This is a convenience method for
- * <code>ILaunchManager.findLaunch(IProcess)</code>.
- *
- * [Issue: this API will be changed to never return null.]
+ * Returns the launch this element originated from.
*
* @return the launch this process is contained in
*/
@@ -60,10 +55,9 @@ public interface IProcess extends IAdaptable, ITerminate {
* Returns the value of a client defined attribute.
*
* @param key the attribute key
- * @return value the attribute value, or <code>null</code> if undefined
+ * @return value the String attribute value, or <code>null</code> if undefined
*/
public String getAttribute(String key);
-
}
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
index 8137cab7b..6bdd542d0 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/LaunchConfiguration.java
@@ -135,7 +135,7 @@ public class LaunchConfiguration extends PlatformObject implements ILaunchConfig
* @see ILaunchConfiguration#launch(String, IProgressMonitor)
*/
public ILaunch launch(String mode, IProgressMonitor monitor) throws CoreException {
- ILaunch launch = new Launch(this, mode, null, null, null);
+ ILaunch launch = new Launch(this, mode, null);
getLaunchManager().addLaunch(launch);
getDelegate().launch(this, mode, launch, monitor);
if (monitor != null && monitor.isCanceled()) {
diff --git a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java
index d7aced68f..1ab66ae10 100644
--- a/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java
+++ b/org.eclipse.debug.core/core/org/eclipse/debug/internal/core/RuntimeProcess.java
@@ -35,7 +35,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
private static final int TIME_TO_WAIT_FOR_THREAD_DEATH = 500; // ms
/**
- * The launch this process is conatined in
+ * The launch this process is contained in
*/
private ILaunch fLaunch;
@@ -130,7 +130,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
}
/**
- * Sets the launch this process is conatined in
+ * Sets the launch this process is contained in
*
* @param launch the launch this process is contained in
*/
@@ -219,7 +219,7 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
private void fireEvent(DebugEvent event) {
DebugPlugin manager= DebugPlugin.getDefault();
if (manager != null) {
- manager.fireDebugEvent(event);
+ manager.fireDebugEventSet(new DebugEvent[]{event});
}
}
@@ -259,17 +259,14 @@ public class RuntimeProcess extends PlatformObject implements IProcess {
}
if (adapter.equals(IDebugTarget.class)) {
ILaunch launch = getLaunch();
- if (launch != null) {
- IDebugTarget[] targets = launch.getDebugTargets();
- for (int i = 0; i < targets.length; i++) {
- if (this.equals(targets[i].getProcess())) {
- return targets[i];
- }
+ IDebugTarget[] targets = launch.getDebugTargets();
+ for (int i = 0; i < targets.length; i++) {
+ if (this.equals(targets[i].getProcess())) {
+ return targets[i];
}
}
return null;
}
return super.getAdapter(adapter);
}
-}
-
+} \ No newline at end of file

Back to the top