Chris Nelson wrote:
Been attempting to try out Martin's jruby-debug code from debug-commons and haven't been able to get much of anywhere. I assume I'm missing something rather obvious, but I have not been able to get it to load. I had to make a small change to jruby trunk for Martin's code to compile (making RubyThread constructor protected instead of private) and then I was able to compile and build a jruby-debug.jar file. However, how is this library designed to be loaded? I tried the obvious, doing require 'jruby-debug.jar' in a ruby script. This didn't work, as the code that tries to find a java extension library expects to find a class that implements BasicLibraryService, whereas the jruby-debug code has RubyDebugBaseLibrary which implements Library (not BasicLibraryService). It appears the right way to use this code would be to have it added using registerBuiltIn in Ruby.initLibraries so it will be used when any code does require 'ruby_debug.so'. Is there a different way to do this other than adding a line to Ruby.java?

Hi Chris,

this is exactly what I did. I have patched JRuby's trunk on my disk in a way you described[1]. To be honest I did not care too much about the best integration with JRuby since it does not prevent me from working on jruby-debug at all. I would start to solving this after there is something usable for JRuby users which is far from true in the meantime.
Looking forward to your patches, contributions! ;)

Regards,
        m.

PS: I'll add note about this to the jruby-debug's README.

[1]
svn di src/org/jruby/RubyThread.java src/org/jruby/Ruby.java
Index: src/org/jruby/RubyThread.java
===================================================================
--- src/org/jruby/RubyThread.java       (revision 4363)
+++ src/org/jruby/RubyThread.java       (working copy)
@@ -266,7 +266,7 @@
         }
     }

-    private RubyThread(Ruby runtime, RubyClass type) {
+    public RubyThread(Ruby runtime, RubyClass type) {
         super(runtime, type);
         this.threadService = runtime.getThreadService();
         // set to default thread group
Index: src/org/jruby/Ruby.java
===================================================================
--- src/org/jruby/Ruby.java     (revision 4363)
+++ src/org/jruby/Ruby.java     (working copy)
@@ -67,6 +67,7 @@
 import org.jruby.compiler.NotCompilableException;
 import org.jruby.compiler.impl.StandardASMCompiler;
 import org.jruby.compiler.yarv.StandardYARVCompiler;
+import org.jruby.debug.RubyDebugBaseLibrary;
 import org.jruby.evaluator.EvaluationState;
 import org.jruby.exceptions.JumpException;
 import org.jruby.exceptions.RaiseException;
@@ -739,6 +740,7 @@

         registerBuiltin("socket.rb", new RubySocket.Service());
         registerBuiltin("rbconfig.rb", new RbConfigLibrary());
+        registerBuiltin("ruby_debug.so", new RubyDebugBaseLibrary());

         for (int i=0; i<BUILTIN_LIBRARIES.length; i++) {
             if(profile.allowBuiltin(BUILTIN_LIBRARIES[i])) {

---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to