Remote debugging mechanism(s) / procedure(s)
--------------------------------------------

                 Key: JRUBY-880
                 URL: http://jira.codehaus.org/browse/JRUBY-880
             Project: JRuby
          Issue Type: Task
            Reporter: Bill Dortch
            Assignee: Thomas E Enebo


We need some means of capturing debugging information from user installations 
of JRuby.  Some bugs are specific to a platform and/or environment, and 
extremely difficult to resolve by deduction or intuition alone, without the 
benefit of empirical data. This seems to hold especially true for Java 
integration issues. (The new JRUBY-878 is a case in point; works fine on my 
machine.)

There are numerous ways this could be accomplished.  I've started out defining 
some environment variables that I can ask a user to set (or send them a script 
to do so) that will trigger debug output to the console, but decided to hold 
off until I get some feedback on this approach.  For example:
{code}
module JavaUtilities
  DEBUG_JCREATE = ENV_JAVA['jruby.debug.ji.jcreate']
  DEBUG_JSEND = ENV_JAVA['jruby.debug.ji.jsend']
....
      self.java_object = JavaUtilities.matching_method(constructors, 
args).new_instance(args) { |proxy, method, *args|
        args.collect! { |arg| Java.java_to_ruby(arg) }
        STDERR.puts "JU:__jsend! [#{self.class}] 
#{method.name}(#{args.join(',')})" if DEBUG_JSEND 
        result = __jsend!(method.name, *args)
        STDERR.puts "JU:__jsend! result = [#{result}]" if DEBUG_JSEND 
        Java.ruby_to_java(result)
      } 
{code}
(This particular example turns out not to be very useful because of the huge 
amount of output; the over-eager capturing of Java method calls by generated 
proxies will be the subject of another issue to follow shortly.)

Other approaches that could be used instead of / in conjunction with this 
include:
 - define one or more methods on the Java "module" for logging events
 - log to a logfile in addition to / instead of the console
 - use standard Java / log4j logging / levels
 - build separate debug versions of JRuby (I _really_ hate this idea, but 
thought I should mention it)
 - what else????

Thoughts?

-Bill

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

    http://xircles.codehaus.org/manage_email

Reply via email to