OLD | NEW |
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 |
(...skipping 10 matching lines...) Expand all Loading... |
21 import com.google.dart.tools.debug.core.DartDebugCorePlugin; | 21 import com.google.dart.tools.debug.core.DartDebugCorePlugin; |
22 import com.google.dart.tools.debug.core.DartLaunchConfigWrapper; | 22 import com.google.dart.tools.debug.core.DartLaunchConfigWrapper; |
23 import com.google.dart.tools.debug.core.DartLaunchConfigurationDelegate; | 23 import com.google.dart.tools.debug.core.DartLaunchConfigurationDelegate; |
24 import com.google.dart.tools.debug.core.coverage.CoverageManager; | 24 import com.google.dart.tools.debug.core.coverage.CoverageManager; |
25 import com.google.dart.tools.debug.core.server.ServerDebugTarget; | 25 import com.google.dart.tools.debug.core.server.ServerDebugTarget; |
26 import com.google.dart.tools.debug.core.server.ServerRemoteProcess; | 26 import com.google.dart.tools.debug.core.server.ServerRemoteProcess; |
27 import com.google.dart.tools.debug.core.util.CoreLaunchUtils; | 27 import com.google.dart.tools.debug.core.util.CoreLaunchUtils; |
28 import com.google.dart.tools.debug.core.util.IRemoteConnectionDelegate; | 28 import com.google.dart.tools.debug.core.util.IRemoteConnectionDelegate; |
29 | 29 |
30 import org.apache.commons.lang3.ObjectUtils; | 30 import org.apache.commons.lang3.ObjectUtils; |
31 import org.eclipse.core.resources.IFile; | 31 import org.eclipse.core.resources.IContainer; |
32 import org.eclipse.core.resources.IResource; | 32 import org.eclipse.core.resources.IResource; |
33 import org.eclipse.core.resources.ResourcesPlugin; | 33 import org.eclipse.core.resources.ResourcesPlugin; |
34 import org.eclipse.core.runtime.CoreException; | 34 import org.eclipse.core.runtime.CoreException; |
35 import org.eclipse.core.runtime.IProgressMonitor; | 35 import org.eclipse.core.runtime.IProgressMonitor; |
36 import org.eclipse.core.runtime.IStatus; | 36 import org.eclipse.core.runtime.IStatus; |
37 import org.eclipse.core.runtime.NullProgressMonitor; | 37 import org.eclipse.core.runtime.NullProgressMonitor; |
38 import org.eclipse.core.runtime.Status; | 38 import org.eclipse.core.runtime.Status; |
39 import org.eclipse.debug.core.DebugException; | 39 import org.eclipse.debug.core.DebugException; |
40 import org.eclipse.debug.core.DebugPlugin; | 40 import org.eclipse.debug.core.DebugPlugin; |
41 import org.eclipse.debug.core.ILaunch; | 41 import org.eclipse.debug.core.ILaunch; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 configuration.getWorkingCopy()); | 83 configuration.getWorkingCopy()); |
84 | 84 |
85 launchConfig.markAsLaunched(); | 85 launchConfig.markAsLaunched(); |
86 | 86 |
87 boolean enableDebugging = ILaunchManager.DEBUG_MODE.equals(mode) | 87 boolean enableDebugging = ILaunchManager.DEBUG_MODE.equals(mode) |
88 && !DartCoreDebug.DISABLE_CLI_DEBUGGER; | 88 && !DartCoreDebug.DISABLE_CLI_DEBUGGER; |
89 | 89 |
90 terminateSameLaunches(launch); | 90 terminateSameLaunches(launch); |
91 | 91 |
92 launchVM(launch, launchConfig, enableDebugging, monitor); | 92 launchVM(launch, launchConfig, enableDebugging, monitor); |
93 | |
94 } | 93 } |
95 | 94 |
96 @Override | 95 @Override |
97 public IDebugTarget performRemoteConnection(String host, int port, IFile file, | 96 public IDebugTarget performRemoteConnection(String host, int port, IContainer
container, |
98 IProgressMonitor monitor, boolean usePubServe) throws CoreException { | 97 IProgressMonitor monitor, boolean usePubServe) throws CoreException { |
99 if (monitor == null) { | 98 if (monitor == null) { |
100 monitor = new NullProgressMonitor(); | 99 monitor = new NullProgressMonitor(); |
101 } | 100 } |
102 | 101 |
103 ILaunch launch = CoreLaunchUtils.createTemporaryLaunch( | 102 ILaunch launch = CoreLaunchUtils.createTemporaryLaunch( |
104 DartDebugCorePlugin.SERVER_LAUNCH_CONFIG_ID, | 103 DartDebugCorePlugin.SERVER_LAUNCH_CONFIG_ID, |
105 host + "[" + port + "]"); | 104 host + "[" + port + "]"); |
106 | 105 |
107 monitor.beginTask("Opening Connection...", 1); | 106 monitor.beginTask("Opening Connection...", 1); |
108 | 107 |
109 try { | 108 try { |
110 if (file != null) { | 109 if (container != null) { |
111 ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration
(); | 110 ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration
(); |
112 DartLaunchConfigWrapper wrapper = new DartLaunchConfigWrapper(launchConf
iguration); | 111 DartLaunchConfigWrapper wrapper = new DartLaunchConfigWrapper(launchConf
iguration); |
113 wrapper.setApplicationName(file.getFullPath().toPortableString()); | 112 wrapper.setSourceDirectoryName(container.getFullPath().toPortableString(
)); |
114 } | 113 } |
115 | 114 |
116 CoreLaunchUtils.addLaunch(launch); | 115 CoreLaunchUtils.addLaunch(launch); |
117 | 116 |
118 ServerRemoteProcess process = new ServerRemoteProcess(launch); | 117 ServerRemoteProcess process = new ServerRemoteProcess(launch); |
119 | 118 |
120 ServerDebugTarget debugTarget = new ServerDebugTarget(launch, process, hos
t, port); | 119 ServerDebugTarget debugTarget = new ServerDebugTarget(launch, process, hos
t, port); |
121 | 120 |
122 process.setTarget(debugTarget); | 121 process.setTarget(debugTarget); |
123 | 122 |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 } | 394 } |
396 } | 395 } |
397 | 396 |
398 return path; | 397 return path; |
399 } else { | 398 } else { |
400 return scriptPath; | 399 return scriptPath; |
401 } | 400 } |
402 } | 401 } |
403 | 402 |
404 } | 403 } |
OLD | NEW |