jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

View: New views
9 Messages — Rating Filter:   Alert me  

jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

by Chris Nelson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Guys,

Success!  I now have a working version of jruby-debug gem.  What's more, when I installed this in my JRuby gems directory I was then able to install the standard ruby-debug gem, since it saw that I had a ruby-debug-base gem already installed.  I was then able to run rdebug on a very simple ruby script.  Also, I was able to do all this without  needing the line in Ruby.java to load our library via build registerBuiltIn, since I added a BasicLibraryService impl to do it via a require 'ruby_debug_base.jar'.  I don't know about you guys, but I'm feeling like this approach is probably the right way to go, as it seems the least intrusive to me.

Martin, is there any chance I could get commit rights to SVN so I can check all this in and let other folks start playing with it?

--Chris

On 10/7/07, Chris Nelson <me@...> wrote:
Peter and Martin,

As far as BasicLibraryService, there are (I think) 2 approaches we could pursue to having our code replace the c ruby-debug code for folks running jruby. 

Right now, we're patching jruby to add Martin's library in a way so that code that does require 'ruby_debug.so' gets our libary.  This allows our code to work with the normal ruby-debug gems.  However, the way I got it to work is by installing the ruby-debug gems in MRI ruby and running jruby with GEM_HOME pointing at my MRI gems directory.  This is because doing a gem install ruby-debug-base will fail in jruby because it will try to compile the native c code.

The other way to get this working is to make our own jruby version of ruby-debug-base which includes and requires in our jruby-debug.jar instead of ruby_debug.so.  This would mean our code would need to have an implementation of BasicLibraryService.  I'm definitely not a gems expert but I work with Jim Weirich (guy who wrote it) and if I'm understanding him correctly we should be able to have a java specific version of ruby-debug-base published alongside of the MRI version and when a user does a gem install ruby-debug-base they will be prompted to choose which version they want.  I'm not yet clear on all the details here so it may require some coordination with the ruby-debug guys but I'm guessing that won't be a problem.

My thinking is this second way would be the most seemless user experience.  If someone has another way I'm not thinking of, please jump in.  For now I'm going to try to put together a jruby debug-base gem and see if I can get it to work locally.  I think it shouldn't be too hard (famous last words  :) ).

--Chris


On 10/3/07, Peter Brant <peter.brant@...> wrote:
Hi Martin and Chris,

I'd like to help out with jruby-debug too.  To avoid duplication of
effort, are there specific things you guys are working on?  Barring
that, I don't have much of a plan besides to poke around, see what
doesn't work, and fix it.

First patch here http://jira.codehaus.org/browse/JRUBY-1286 (actually
a JRuby bug that was preventing exit in rdebug from working).

Regarding BasicLibraryService, does this really help us?  We still
need to associate RubyDebugBaseLibrary with a specific name we can't
pick.  Or could jruby-debug be packaged as a JAR file and picked up
that way with the standard name?

(for now, I did change the registerBuiltin() call in my copy to use
reflection so jruby_trunk and jruby-debug can be separate projects)

Pete

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

    http://xircles.codehaus.org/manage_email




Re: jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

by Dudley Flanders :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 8, 2007, at 11:36 AM, Chris Nelson wrote:

> Guys,
>
> Success!  I now have a working version of jruby-debug gem.  What's  
> more, when I installed this in my JRuby gems directory I was then  
> able to install the standard ruby-debug gem, since it saw that I  
> had a ruby-debug-base gem already installed.  I was then able to  
> run rdebug on a very simple ruby script.  Also, I was able to do  
> all this without  needing the line in Ruby.java to load our library  
> via build registerBuiltIn, since I added a BasicLibraryService impl  
> to do it via a require 'ruby_debug_base.jar'.  I don't know about  
> you guys, but I'm feeling like this approach is probably the right  
> way to go, as it seems the least intrusive to me.

If I could hug you through the network, I would. This is the most  
awesome thing I've heard all week!

:dudley


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

    http://xircles.codehaus.org/manage_email


Re: jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris Nelson wrote:

> Guys,
>
> Success!  I now have a working version of jruby-debug gem.  What's more,
> when I installed this in my JRuby gems directory I was then able to
> install the standard ruby-debug gem, since it saw that I had a
> ruby-debug-base gem already installed.  I was then able to run rdebug on
> a very simple ruby script.  Also, I was able to do all this without  
> needing the line in Ruby.java to load our library via build
> registerBuiltIn, since I added a BasicLibraryService impl to do it via a
> require 'ruby_debug_base.jar'.  I don't know about you guys, but I'm
> feeling like this approach is probably the right way to go, as it seems
> the least intrusive to me.

That all sounds great. Looking forward to the commit.

> Martin, is there any chance I could get commit rights to SVN so I can
> check all this in and let other folks start playing with it?

Yup, see the email, I've just sent you.

        m.

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

    http://xircles.codehaus.org/manage_email


Re: jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

by Peter Brant :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Agreed, very cool.

Pete

On 10/8/07, Chris Nelson <me@...> wrote:
> I don't know about you guys, but I'm feeling like this approach is probably
> the right way to go, as it seems the least intrusive to me.
>

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

    http://xircles.codehaus.org/manage_email


Re: jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

by Chris Nelson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ok, I've checked in my code.  You'll still need the one line patch to RubyThread in jruby to use it.  I'll open a JIRA issue for that and see if we can get that into jruby trunk.  After that, check out the jruby-debug code and run rake install_gem.  This should give you a somewhat working version of ruby-debug-base.  I've matched the version number to ruby-debug, so you can do a normal gem install of ruby-debug.  From there rdebug should work for basic things, I've been running it using jruby rdebug <script>. 

Happy debugging!

--Chris

On 10/8/07, Peter Brant <peter.brant@...> wrote:
Agreed, very cool.

Pete

On 10/8/07, Chris Nelson <me@...> wrote:
> I don't know about you guys, but I'm feeling like this approach is probably
> the right way to go, as it seems the least intrusive to me.
>

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

     http://xircles.codehaus.org/manage_email



Re: jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

by Martin Krauskopf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris Nelson wrote:
> [...]
> From there rdebug should work for basic things, I've been running it
> using jruby rdebug <script>.

...should work for basic things, but very unreliably. It is so immature
that it does not worth it to file a bug or send us any complains yet ;)

Actually I've only put together:

- core base infrastructure
- frame listing
- stepping over
- stepping into
- continue
- breakpoint setting
- local variables listing (Chris' patch)

which _somehow, not always_ works.

> Happy debugging!

Really optimistic, but that's good I suppose ;)

I would rather take this announcement for those who wants to help with
coding. Definitely unusable for users.

We will post announcement to users ML when we have something available.

Cheers,
        m.

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

    http://xircles.codehaus.org/manage_email


Re: jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

by Chris Nelson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Everything Martin says here is correct, and I've only put together a smattering of unit tests for the list variable stuff and them not checked in.  So by all means, caveat emptor.  Didn't mean to get carried away :)

--Chris

On 10/9/07, Martin Krauskopf <Martin.Krauskopf@...> wrote:
Chris Nelson wrote:
> [...]
> From there rdebug should work for basic things, I've been running it
> using jruby rdebug <script>.

...should work for basic things, but very unreliably. It is so immature
that it does not worth it to file a bug or send us any complains yet ;)

Actually I've only put together:

- core base infrastructure
- frame listing
- stepping over
- stepping into
- continue
- breakpoint setting
- local variables listing (Chris' patch)

which _somehow, not always_ works.

> Happy debugging!

Really optimistic, but that's good I suppose ;)

I would rather take this announcement for those who wants to help with
coding. Definitely unusable for users.

We will post announcement to users ML when we have something available.

Cheers,
        m.

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

    http://xircles.codehaus.org/manage_email



Re: jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

by Chris Nelson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Heh, thanks Dudley, but Martin deserves most of the love.  I built on and packaged what is mostly his work.

--Chris

On 10/8/07, Dudley Flanders < dudley@...> wrote:

On Oct 8, 2007, at 11:36 AM, Chris Nelson wrote:

> Guys,
>
> Success!  I now have a working version of jruby-debug gem.  What's
> more, when I installed this in my JRuby gems directory I was then
> able to install the standard ruby-debug gem, since it saw that I
> had a ruby-debug-base gem already installed.  I was then able to
> run rdebug on a very simple ruby script.  Also, I was able to do
> all this without  needing the line in Ruby.java to load our library
> via build registerBuiltIn, since I added a BasicLibraryService impl
> to do it via a require 'ruby_debug_base.jar'.  I don't know about
> you guys, but I'm feeling like this approach is probably the right
> way to go, as it seems the least intrusive to me.

If I could hug you through the network, I would. This is the most
awesome thing I've heard all week!

:dudley


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

    http://xircles.codehaus.org/manage_email



Re: jruby-debug gem (was Re: [jruby-dev] Helping out with jruby-debug)

by Dudley Flanders :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Oct 9, 2007, at 9:15 AM, Chris Nelson wrote:

> Heh, thanks Dudley, but Martin deserves most of the love.  I built  
> on and packaged what is mostly his work.

Oh, I didn't want Martin to get left out. He gets love, too. There's  
plenty to go around :-) I was just excited to see someone helping him  
out on this, since I know Martin has his hands full of netbeans.

:dudley


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

    http://xircles.codehaus.org/manage_email