Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: dart/editor/tools/plugins/com.google.dart.tools.debug.core/src/com/google/dart/tools/debug/core/configs/DartServerLaunchConfigurationDelegate.java

Issue 11142018: svn merge -c 13655 bleeding_edge trunk (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | dart/tools/VERSION » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012, the Dart project authors. 2 * Copyright (c) 2012, the Dart project authors.
3 * 3 *
4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except 4 * Licensed under the Eclipse Public License v1.0 (the "License"); you may not u se this file except
5 * in compliance with the License. You may obtain a copy of the License at 5 * in compliance with the License. You may obtain a copy of the License at
6 * 6 *
7 * http://www.eclipse.org/legal/epl-v10.html 7 * http://www.eclipse.org/legal/epl-v10.html
8 * 8 *
9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License 9 * Unless required by applicable law or agreed to in writing, software distribut ed under the License
10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express 10 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY K IND, either express
11 * or implied. See the License for the specific language governing permissions a nd limitations under 11 * or implied. See the License for the specific language governing permissions a nd limitations under
12 * the License. 12 * the License.
13 */ 13 */
14 package com.google.dart.tools.debug.core.configs; 14 package com.google.dart.tools.debug.core.configs;
15 15
16 import com.google.dart.tools.core.DartCore; 16 import com.google.dart.tools.core.DartCore;
17 import com.google.dart.tools.core.model.DartSdkManager; 17 import com.google.dart.tools.core.model.DartSdkManager;
18 import com.google.dart.tools.debug.core.DartDebugCorePlugin; 18 import com.google.dart.tools.debug.core.DartDebugCorePlugin;
19 import com.google.dart.tools.debug.core.DartLaunchConfigWrapper; 19 import com.google.dart.tools.debug.core.DartLaunchConfigWrapper;
20 import com.google.dart.tools.debug.core.server.ServerDebugTarget;
21 import com.google.dart.tools.debug.core.util.NetUtils; 20 import com.google.dart.tools.debug.core.util.NetUtils;
22 21
23 import org.eclipse.core.resources.IResource; 22 import org.eclipse.core.resources.IResource;
24 import org.eclipse.core.resources.ResourcesPlugin; 23 import org.eclipse.core.resources.ResourcesPlugin;
25 import org.eclipse.core.runtime.CoreException; 24 import org.eclipse.core.runtime.CoreException;
26 import org.eclipse.core.runtime.IProgressMonitor; 25 import org.eclipse.core.runtime.IProgressMonitor;
27 import org.eclipse.core.runtime.IStatus; 26 import org.eclipse.core.runtime.IStatus;
28 import org.eclipse.core.runtime.Path; 27 import org.eclipse.core.runtime.Path;
29 import org.eclipse.core.runtime.Status; 28 import org.eclipse.core.runtime.Status;
30 import org.eclipse.debug.core.DebugException; 29 import org.eclipse.debug.core.DebugException;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 DartDebugCorePlugin.createErrorStatus("The executable path for the Dar t VM has not been set.")); 107 DartDebugCorePlugin.createErrorStatus("The executable path for the Dar t VM has not been set."));
109 } 108 }
110 109
111 List<String> commandsList = new ArrayList<String>(); 110 List<String> commandsList = new ArrayList<String>();
112 111
113 int connectionPort = NetUtils.findUnusedPort(DEFAULT_PORT_NUMBER); 112 int connectionPort = NetUtils.findUnusedPort(DEFAULT_PORT_NUMBER);
114 113
115 commandsList.add(vmExecPath); 114 commandsList.add(vmExecPath);
116 commandsList.addAll(Arrays.asList(launchConfig.getVmArgumentsAsArray())); 115 commandsList.addAll(Arrays.asList(launchConfig.getVmArgumentsAsArray()));
117 116
118 if (enableDebugging && !DartCore.isWindows()) { 117 // BUG(5883) Debugging of standalone programs is disabled
119 commandsList.add("--debug:" + connectionPort); 118 // because it sometimes leads to program crashes.
120 } 119 // if (enableDebugging && !DartCore.isWindows()) {
120 // commandsList.add("--debug:" + connectionPort);
121 // }
121 122
122 String packageRoot = DartCore.getPlugin().getPackageRootPref(); 123 String packageRoot = DartCore.getPlugin().getPackageRootPref();
123 if (packageRoot != null) { 124 if (packageRoot != null) {
124 packageRoot = new Path(packageRoot).makeAbsolute().toOSString(); 125 packageRoot = new Path(packageRoot).makeAbsolute().toOSString();
125 String fileSeparator = System.getProperty("file.separator"); 126 String fileSeparator = System.getProperty("file.separator");
126 if (!packageRoot.endsWith(fileSeparator)) { 127 if (!packageRoot.endsWith(fileSeparator)) {
127 packageRoot += fileSeparator; 128 packageRoot += fileSeparator;
128 } 129 }
129 commandsList.add("--package-root=" + packageRoot); 130 commandsList.add("--package-root=" + packageRoot);
130 } 131 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 if (runtimeProcess != null) { 170 if (runtimeProcess != null) {
170 runtimeProcess.destroy(); 171 runtimeProcess.destroy();
171 } 172 }
172 173
173 throw new CoreException( 174 throw new CoreException(
174 DartDebugCorePlugin.createErrorStatus("Error starting Dart VM process" )); 175 DartDebugCorePlugin.createErrorStatus("Error starting Dart VM process" ));
175 } 176 }
176 177
177 eclipseProcess.setAttribute(IProcess.ATTR_CMDLINE, generateCommandLine(comma nds)); 178 eclipseProcess.setAttribute(IProcess.ATTR_CMDLINE, generateCommandLine(comma nds));
178 179
179 if (enableDebugging && !DartCore.isWindows()) { 180 // BUG(5883) Debugging of standalone programs is disabled
180 ServerDebugTarget debugTarget = new ServerDebugTarget(launch, eclipseProce ss, connectionPort); 181 // because it sometimes leads to program crashes.
181 182 // if (enableDebugging && !DartCore.isWindows()) {
182 try { 183 // ServerDebugTarget debugTarget = new ServerDebugTarget(launch, eclipsePro cess, connectionPort);
183 debugTarget.connect(); 184 //
184 185 // try {
185 launch.addDebugTarget(debugTarget); 186 // debugTarget.connect();
186 } catch (DebugException ex) { 187 //
187 // We don't throw an exception if the process died before we could conne ct. 188 // launch.addDebugTarget(debugTarget);
188 if (!isProcessDead(runtimeProcess)) { 189 // } catch (DebugException ex) {
189 throw ex; 190 // // We don't throw an exception if the process died before we could con nect.
190 } 191 // if (!isProcessDead(runtimeProcess)) {
191 } 192 // throw ex;
192 } 193 // }
194 // }
195 // }
193 196
194 monitor.done(); 197 monitor.done();
195 } 198 }
196 199
197 private String describe(ProcessBuilder processBuilder) { 200 private String describe(ProcessBuilder processBuilder) {
198 StringBuilder builder = new StringBuilder(); 201 StringBuilder builder = new StringBuilder();
199 202
200 for (String arg : processBuilder.command()) { 203 for (String arg : processBuilder.command()) {
201 // Showing the --debug option doesn't provide a lot of value. 204 // Showing the --debug option doesn't provide a lot of value.
202 if (arg.startsWith("--debug")) { 205 if (arg.startsWith("--debug")) {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 return process.getOutputStream(); 357 return process.getOutputStream();
355 } 358 }
356 359
357 @Override 360 @Override
358 public int waitFor() throws InterruptedException { 361 public int waitFor() throws InterruptedException {
359 return process.waitFor(); 362 return process.waitFor();
360 } 363 }
361 }; 364 };
362 } 365 }
363 } 366 }
OLDNEW
« no previous file with comments | « no previous file | dart/tools/VERSION » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698