|
From: <caw...@us...> - 2007-05-03 13:45:23
|
Revision: 2421
http://svn.sourceforge.net/rubyeclipse/?rev=2421&view=rev
Author: cawilliams
Date: 2007-05-03 06:45:21 -0700 (Thu, 03 May 2007)
Log Message:
-----------
clean up the hack I had in before for rdebug-ide to work without using cmd.exe on windows. I was inserting the debugger arguments and filename in the wrong places in the command line (that only worked for simple command lines), and rdebug-ide would try to parse out options for the file we were debugging!
The upshot is that now we handle more complex command lines like those that happen under the hood of RadRails when invoking a webserver under debug mode.
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
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-05-02 19:04:01 UTC (rev 2420)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java 2007-05-03 13:45:21 UTC (rev 2421)
@@ -2,16 +2,11 @@
import java.io.File;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.debug.core.ILaunch;
import org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy;
import org.rubypeople.rdt.internal.debug.core.model.RubyDebugTarget;
-import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
import org.rubypeople.rdt.launching.IVMInstall;
import org.rubypeople.rdt.launching.VMRunnerConfiguration;
@@ -24,16 +19,27 @@
public RDebugVMDebugger(IVMInstall vmInstance) {
super(vmInstance);
}
-
+
@Override
protected List<String> constructProgramString(VMRunnerConfiguration config) throws CoreException {
- List<String> string = super.constructProgramString(config);
- string.add(findRDebugExecutable(fVMInstance.getInstallLocation()));
- return string;
+ String[] args = config.getProgramArguments();
+ List<String> argList = new ArrayList<String>();
+ argList.add(StandardVMDebugger.END_OF_OPTIONS_DELIMITER);
+ for (int i = 0; i < args.length; i++) {
+ argList.add(args[i]);
+ }
+ config.setProgramArguments(argList.toArray(new String[argList.size()]));
+ return super.constructProgramString(config);
}
-
+
+ @Override
protected List<String> debugSpecificVMArgs(RubyDebugTarget debugTarget) {
+ return new ArrayList<String>();
+ }
+
+ protected List<String> debugArgs(RubyDebugTarget debugTarget) {
List<String> arguments = new ArrayList<String>();
+ arguments.add(findRDebugExecutable(fVMInstance.getInstallLocation()));
arguments.add(PORT_SWITCH);
arguments.add(Integer.toString(debugTarget.getPort()));
if (isDebuggerVerbose()) {
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-05-02 19:04:01 UTC (rev 2420)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMDebugger.java 2007-05-03 13:45:21 UTC (rev 2421)
@@ -3,6 +3,7 @@
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -64,8 +65,7 @@
RubyDebugTarget debugTarget = new RubyDebugTarget(launch, port);
List<String> arguments = constructProgramString(config);
-// arguments.add(program);
-
+
// 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
@@ -75,14 +75,15 @@
String[] cp = config.getLoadPath();
if (cp.length > 0) {
- arguments.addAll(convertLoadPath(cp));
+ arguments.addAll(convertLoadPath(cp)); // TODO If our working directory is equal to loadpath, don't add loadpath
}
-
- arguments.addAll(debugSpecificVMArgs(debugTarget));
-
+ arguments.addAll(debugSpecificVMArgs(debugTarget));
+
arguments.add(StandardVMRunner.END_OF_OPTIONS_DELIMITER);
+
+ arguments.addAll(debugArgs(debugTarget));
- arguments.add(config.getFileToLaunch());
+ arguments.add(config.getFileToLaunch());
addArguments(config.getProgramArguments(), arguments);
String[] cmdLine = new String[arguments.size()];
arguments.toArray(cmdLine);
@@ -140,6 +141,10 @@
// }
}
+ protected Collection<String> debugArgs(RubyDebugTarget debugTarget) {
+ return new ArrayList<String>();
+ }
+
protected RubyDebuggerProxy getDebugProxy(RubyDebugTarget debugTarget) {
return new RubyDebuggerProxy(debugTarget, false /* isRubyDebug*/);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|