| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 93 |
| 94 } | 94 } |
| 95 | 95 |
| 96 @Override | 96 @Override |
| 97 public IDebugTarget performRemoteConnection(String host, int port, IFile file, | 97 public IDebugTarget performRemoteConnection(String host, int port, IContainer
container, |
| 98 IProgressMonitor monitor, boolean usePubServe) throws CoreException { | 98 IProgressMonitor monitor, boolean usePubServe) throws CoreException { |
| 99 if (monitor == null) { | 99 if (monitor == null) { |
| 100 monitor = new NullProgressMonitor(); | 100 monitor = new NullProgressMonitor(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 ILaunch launch = CoreLaunchUtils.createTemporaryLaunch( | 103 ILaunch launch = CoreLaunchUtils.createTemporaryLaunch( |
| 104 DartDebugCorePlugin.SERVER_LAUNCH_CONFIG_ID, | 104 DartDebugCorePlugin.SERVER_LAUNCH_CONFIG_ID, |
| 105 host + "[" + port + "]"); | 105 host + "[" + port + "]"); |
| 106 | 106 |
| 107 monitor.beginTask("Opening Connection...", 1); | 107 monitor.beginTask("Opening Connection...", 1); |
| 108 | 108 |
| 109 try { | 109 try { |
| 110 if (file != null) { | 110 if (container != null) { |
| 111 ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration
(); | 111 ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration
(); |
| 112 DartLaunchConfigWrapper wrapper = new DartLaunchConfigWrapper(launchConf
iguration); | 112 DartLaunchConfigWrapper wrapper = new DartLaunchConfigWrapper(launchConf
iguration); |
| 113 wrapper.setApplicationName(file.getFullPath().toPortableString()); | 113 wrapper.setSourceDirectoryName(container.getFullPath().toPortableString(
)); |
| 114 } | 114 } |
| 115 | 115 |
| 116 CoreLaunchUtils.addLaunch(launch); | 116 CoreLaunchUtils.addLaunch(launch); |
| 117 | 117 |
| 118 ServerRemoteProcess process = new ServerRemoteProcess(launch); | 118 ServerRemoteProcess process = new ServerRemoteProcess(launch); |
| 119 | 119 |
| 120 ServerDebugTarget debugTarget = new ServerDebugTarget(launch, process, hos
t, port); | 120 ServerDebugTarget debugTarget = new ServerDebugTarget(launch, process, hos
t, port); |
| 121 | 121 |
| 122 process.setTarget(debugTarget); | 122 process.setTarget(debugTarget); |
| 123 | 123 |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 } | 395 } |
| 396 } | 396 } |
| 397 | 397 |
| 398 return path; | 398 return path; |
| 399 } else { | 399 } else { |
| 400 return scriptPath; | 400 return scriptPath; |
| 401 } | 401 } |
| 402 } | 402 } |
| 403 | 403 |
| 404 } | 404 } |
| OLD | NEW |