|
From: <caw...@us...> - 2007-04-21 00:03:41
|
Revision: 2358
http://svn.sourceforge.net/rubyeclipse/?rev=2358&view=rev
Author: cawilliams
Date: 2007-04-20 17:03:40 -0700 (Fri, 20 Apr 2007)
Log Message:
-----------
modify how we construct the executable. Instead of returning a string, we return a list of strings. This lets us hack it for ruby-debug so we can invoke ruby on the generic ruby-debug-ide command.
using the ruby-debug-ide.cmd file on windows led us to have a orphaned ruby process that wasn't terminated (terminate would kill cmd.exe). So now on Win32 we can forcibly terminate a ruby-debug session running rails and then continue to relaunch in debug mode! hurray!
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java 2007-04-20 23:56:02 UTC (rev 2357)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java 2007-04-21 00:03:40 UTC (rev 2358)
@@ -19,30 +19,17 @@
private static final String PORT_SWITCH = "--port";
private static final String VERBOSE_FLAG = "-d";
- private static final String RDEBUG_EXECUTABLE_WINDOWS = "rdebug-ide.cmd";
private static final String RDEBUG_EXECUTABLE = "rdebug-ide";
public RDebugVMDebugger(IVMInstall vmInstance) {
super(vmInstance);
}
-
- /*
- * (non-Javadoc)
- *
- * @see org.rubypeople.rdt.launching.IVMRunner#run(org.rubypeople.rdt.launching.VMRunnerConfiguration,
- * org.eclipse.debug.core.ILaunch,
- * org.eclipse.core.runtime.IProgressMonitor)
- */
- public void run(VMRunnerConfiguration config, ILaunch launch, IProgressMonitor monitor) throws CoreException {
-
- // Set it up to use rdebug executable
- Map map = config.getVMSpecificAttributesMap();
- if (map == null) map = new HashMap();
- String executable = findRDebugExecutable(fVMInstance.getInstallLocation());
- map.put(IRubyLaunchConfigurationConstants.ATTR_RUBY_COMMAND, executable);
- config.setVMSpecificAttributesMap(map);
-
- super.run(config, launch, monitor);
+
+ @Override
+ protected List<String> constructProgramString(VMRunnerConfiguration config) throws CoreException {
+ List<String> string = super.constructProgramString(config);
+ string.add(findRDebugExecutable(fVMInstance.getInstallLocation()));
+ return string;
}
protected List<String> debugSpecificVMArgs(RubyDebugTarget debugTarget) {
@@ -60,13 +47,7 @@
}
public static String findRDebugExecutable(File vmInstallLocation) {
- // see StandardVMRunner.constructProgramString
- String cmdWin = RDEBUG_EXECUTABLE_WINDOWS;
- String path = vmInstallLocation + File.separator + "bin" + File.separator + cmdWin;
- if (new File(path).exists()) {
- return cmdWin;
- }
- return RDEBUG_EXECUTABLE;
+ return vmInstallLocation + File.separator + "bin" + File.separator + RDEBUG_EXECUTABLE;
}
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-04-20 23:56:02 UTC (rev 2357)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-04-21 00:03:40 UTC (rev 2358)
@@ -63,9 +63,8 @@
subMonitor.subTask(LaunchingMessages.StandardVMDebugger_Constructing_command_line____3);
RubyDebugTarget debugTarget = new RubyDebugTarget(launch, port);
- String program = constructProgramString(config);
- List<String> arguments = new ArrayList<String>(12);
- arguments.add(program);
+ List<String> arguments = constructProgramString(config);
+// arguments.add(program);
// VM args are the first thing after the ruby program so that users can
// specify
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-04-20 23:56:02 UTC (rev 2357)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-04-21 00:03:40 UTC (rev 2358)
@@ -125,7 +125,8 @@
* @return full path to ruby executable
* @exception CoreException if unable to locate an executeable
*/
- protected String constructProgramString(VMRunnerConfiguration config) throws CoreException {
+ protected List<String> constructProgramString(VMRunnerConfiguration config) throws CoreException {
+ List<String> string = new ArrayList<String>();
// Look for the user-specified ruby executable command
String command= null;
Map map= config.getVMSpecificAttributesMap();
@@ -139,18 +140,21 @@
if (exe == null) {
abort(MessageFormat.format(LaunchingMessages.StandardVMRunner_Unable_to_locate_executable_for__0__1, fVMInstance.getName()), null, IRubyLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
}
- return exe.getAbsolutePath();
+ string.add(exe.getAbsolutePath());
+ return string;
}
// Build the path to the ruby executable. First try 'bin'
String installLocation = fVMInstance.getInstallLocation().getAbsolutePath() + File.separatorChar;
File exe = new File(installLocation + "bin" + File.separatorChar + command); //$NON-NLS-1$
if (fileExists(exe)){
- return exe.getAbsolutePath();
+ string.add(exe.getAbsolutePath());
+ return string;
}
exe = new File(exe.getAbsolutePath() + ".exe"); //$NON-NLS-1$
if (fileExists(exe)){
- return exe.getAbsolutePath();
+ string.add(exe.getAbsolutePath());
+ return string;
}
// not found
@@ -186,10 +190,8 @@
subMonitor.beginTask(LaunchingMessages.StandardVMRunner_Launching_VM____1, 2);
subMonitor.subTask(LaunchingMessages.StandardVMRunner_Constructing_command_line____2);
- String program= constructProgramString(config);
- List<String> arguments= new ArrayList<String>();
- arguments.add(program);
+ List<String> arguments= constructProgramString(config);
// VM args are the first thing after the ruby program so that users can specify
// options like '-client' & '-server' which are required to be the first option
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|