|
From: <mba...@us...> - 2006-12-30 09:44:45
|
Revision: 1749
http://svn.sourceforge.net/rubyeclipse/?rev=1749&view=rev
Author: mbarchfe
Date: 2006-12-30 01:44:44 -0800 (Sat, 30 Dec 2006)
Log Message:
-----------
next step for ruby debug integration
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DebuggerRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/PreferenceConstants.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DebuggerRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DebuggerRunner.java 2006-12-30 09:44:19 UTC (rev 1748)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DebuggerRunner.java 2006-12-30 09:44:44 UTC (rev 1749)
@@ -13,79 +13,79 @@
import org.rubypeople.rdt.internal.debug.core.RdtDebugCorePlugin;
import org.rubypeople.rdt.internal.debug.core.RubyDebuggerProxy;
import org.rubypeople.rdt.internal.debug.core.model.RubyDebugTarget;
+import org.rubypeople.rdt.launching.IInterpreter;
public class DebuggerRunner extends InterpreterRunner {
private RubyDebugTarget debugTarget;
- public IProcess run(InterpreterRunnerConfiguration configuration,
- ILaunch launch) throws CoreException {
+ public IProcess run(InterpreterRunnerConfiguration configuration, ILaunch launch) throws CoreException {
debugTarget = new RubyDebugTarget(launch);
IProcess process = super.run(configuration, launch);
debugTarget.setProcess(process);
RubyDebuggerProxy proxy = new RubyDebuggerProxy(debugTarget, isUseRubyDebug());
if (proxy.checkConnection()) {
- proxy.start();
- launch.addDebugTarget(debugTarget);
+ try {
+ if (isUseRubyDebug()) {
+ String pathToRdebugExtension = getDirectoryOfRubyDebuggerFile() + "/rdebugExtension.rb";
+ proxy.registerRdebugExtension(pathToRdebugExtension);
+ }
+ proxy.start();
+ launch.addDebugTarget(debugTarget);
+ } catch (Exception e) {
+ RdtLaunchingPlugin.log(new Status(IStatus.ERROR, RdtLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, e.getMessage(), e));
+ debugTarget.terminate();
+ }
} else {
- RdtLaunchingPlugin
- .log(new Status(
- IStatus.ERROR,
- RdtLaunchingPlugin.PLUGIN_ID,
- IStatus.ERROR,
- RdtLaunchingMessages.RdtLaunchingPlugin_processTerminatedBecauseNoDebuggerConnection,
- null));
+ RdtLaunchingPlugin.log(new Status(IStatus.ERROR, RdtLaunchingPlugin.PLUGIN_ID, IStatus.ERROR, RdtLaunchingMessages.RdtLaunchingPlugin_processTerminatedBecauseNoDebuggerConnection, null));
debugTarget.terminate();
}
return process;
}
- protected void addDebugCommandLineArgument(List commandLine) {
+ protected void addDebugCommandLineArgument(List<String> commandLine) {
if (isUseRubyDebug()) {
commandLine.add("--server");
commandLine.add("--port");
commandLine.add(Integer.toString(debugTarget.getPort()));
commandLine.add("--cport");
- commandLine.add(Integer.toString(debugTarget.getPort()+1));
+ commandLine.add(Integer.toString(debugTarget.getPort() + 1));
commandLine.add("-w");
- commandLine.add("-d");
+ if (isDebuggerVerbose()) {
+ commandLine.add("-d");
+ }
commandLine.add("-f");
commandLine.add("xml");
} else {
if (!debugTarget.isUsingDefaultPort()) {
- commandLine
- .add("-r"
- + debugTarget.getDebugParameterFile()
- .getAbsolutePath());
+ commandLine.add("-r" + debugTarget.getDebugParameterFile().getAbsolutePath());
}
- if (RdtDebugCorePlugin.isRubyDebuggerVerbose()) {
+ if (RdtDebugCorePlugin.isRubyDebuggerVerbose() || isDebuggerVerbose()) {
commandLine.add("-reclipseDebugVerbose");
} else {
commandLine.add("-reclipseDebug");
}
commandLine.add("-I");
- commandLine.add(RdtLaunchingPlugin.osDependentPath(DebuggerRunner
- .getDirectoryOfRubyDebuggerFile().replace('/',
- File.separatorChar)));
+ commandLine.add(RdtLaunchingPlugin.osDependentPath(DebuggerRunner.getDirectoryOfRubyDebuggerFile().replace('/', File.separatorChar)));
}
}
public static String getDirectoryOfRubyDebuggerFile() {
- return RubyCore.getOSDirectory(RdtLaunchingPlugin.getDefault())
- + "ruby";
+ return RubyCore.getOSDirectory(RdtLaunchingPlugin.getDefault()) + "ruby";
}
public boolean isUseRubyDebug() {
- // TODO: use PrefernceConstants ?
- return RdtLaunchingPlugin.getDefault().getPluginPreferences().getBoolean(
- "useRubyDebug");
+ return RdtLaunchingPlugin.getDefault().getPluginPreferences().getBoolean(PreferenceConstants.USE_RUBY_DEBUG);
}
+
+ public boolean isDebuggerVerbose() {
+ return RdtLaunchingPlugin.getDefault().getPluginPreferences().getBoolean(PreferenceConstants.VERBOSE_DEBUGGER);
+ }
- protected RubyInterpreter convertInterpreter(RubyInterpreter rubyInterpreter) {
+ protected IInterpreter convertInterpreter(IInterpreter rubyInterpreter) {
if (isUseRubyDebug()) {
- IPath rdebugLocation = rubyInterpreter.getInstallLocation()
- .removeLastSegments(1);
+ IPath rdebugLocation = rubyInterpreter.getInstallLocation().removeLastSegments(1);
rdebugLocation = rdebugLocation.append("rdebug");
return new RubyInterpreter("rdebug", rdebugLocation);
} else {
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java 2006-12-30 09:44:19 UTC (rev 1748)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunner.java 2006-12-30 09:44:44 UTC (rev 1749)
@@ -50,7 +50,7 @@
}
private List renderCommandLine(InterpreterRunnerConfiguration configuration) {
- List commandLine = new ArrayList();
+ List<String> commandLine = new ArrayList<String>();
addDebugCommandLineArgument(commandLine);
commandLine.addAll(configuration.renderLoadPath());
@@ -63,7 +63,7 @@
}
- protected void addDebugCommandLineArgument(List commandLine) {
+ protected void addDebugCommandLineArgument(List<String> commandLine) {
}
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java 2006-12-30 09:44:19 UTC (rev 1748)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/InterpreterRunnerConfiguration.java 2006-12-30 09:44:44 UTC (rev 1749)
@@ -100,20 +100,20 @@
return RubyRuntime.getDefault().getInterpreter(selectedInterpreter);
}
- protected void addToLoadPath(List loadPath, IProject project) {
+ protected void addToLoadPath(List<String> loadPath, IProject project) {
if (!project.isAccessible()) {
return ;
}
addToLoadPath(loadPath, project.getLocation().toOSString());
}
- private void addToLoadPath(List loadPath, String pathDirectory) {
+ private void addToLoadPath(List<String> loadPath, String pathDirectory) {
loadPath.add("-I");
loadPath.add(RdtLaunchingPlugin.osDependentPath(pathDirectory));
}
- protected List renderLoadPath() {
- List loadPath = new ArrayList();
+ protected List<String> renderLoadPath() {
+ List<String> loadPath = new ArrayList<String>();
RubyProject project = this.getProject();
addToLoadPath(loadPath, project.getProject());
Added: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/PreferenceConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/PreferenceConstants.java (rev 0)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/PreferenceConstants.java 2006-12-30 09:44:44 UTC (rev 1749)
@@ -0,0 +1,6 @@
+package org.rubypeople.rdt.internal.launching;
+
+public class PreferenceConstants {
+ public final static String USE_RUBY_DEBUG = "useRubyDebug";
+ public final static String VERBOSE_DEBUGGER = "verboseDebugger";
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|