This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 157870 - Possibility to pass alternative ruby-debug-ide gem's name
Summary: Possibility to pass alternative ruby-debug-ide gem's name
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-03 20:38 UTC by dezed
Modified: 2009-08-25 16:29 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dezed 2009-02-03 20:38:22 UTC
Trying to run the ruby debugger in netbeans6.5 using ruby1.9.1 as the platform doesn't work

First I got these errors

C:/prog/ruby/bin/rdebug-ide:19:in `load': C:/prog/ruby/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.3.3/bin/rdebug-ide:25:
syntax error, unexpected '.', expecting '|' (SyntaxError)
...r remote debugging") {|options.host|}
...                               ^
C:/prog/ruby/lib/ruby/gems/1.9.1/gems/ruby-debug-ide-0.3.3/bin/rdebug-ide:26: syntax error, unexpected '.', expecting '|'
...r remote debugging") {|options.port|}
...                               ^
    from C:/prog/ruby/bin/rdebug-ide:19:in `<main>'

I monkey patched
  opts.on("-h", "--host HOST", "Host name used for remote debugging") {|options.host|}
  opts.on("-p", "--port PORT", Integer, "Port used for remote debugging") {|options.port|}
to
  opts.on("-h", "--host HOST", "Host name used for remote debugging") {|x|options.host=x}
  opts.on("-p", "--port PORT", Integer, "Port used for remote debugging") {|x|options.port=x}

That got rid of the syntax errors but now the IDE just waits for the debugger session

when i run it from the command line  i got a popup saying

"This application has failed to start because msvcrt-ruby18.dll was not found" wich i guess means that there is no
compiled version for 1.9

Here is a response from Martin Krauskopf

"
The bigger problem is that so far nobody probably tried ruby-debug-ide against Ruby 1.9, so this needs to be looked on.
Moreover I think that also ruby-debug-base might not be ready for Ruby 1.9....
I've just noticed that linecache module cannot be compiled against 1.9. So likely the whole ruby-debugging backend is
not ready for 1.9 so far, since dependencies are:

  ruby-debug ---------+
                      |
                      v
  ruby-debug-ide -> ruby-debug-base -> linecache
"
Comment 1 Erno Mononen 2009-02-12 11:34:05 UTC
Setting TM to 7.0 for now. Depends on the backend really as described in Martin's diagram.
Comment 2 Masaki Katakai 2009-05-08 11:33:50 UTC
Any plan for 6.7?

I'm asked from community folk about the status for 1.9.1 and debugger support.
Comment 3 Erno Mononen 2009-05-12 13:00:41 UTC
This really depends on ruby-debug-base at this point, once it is ready for 1.9.x we can proceed on the IDE side. We 
haven't had anyone from NB contributing to ruby-debug-base and for 6.7 there isn't enough time to become familiar 
enough with it to be able to help make it work with 1.9.1.
Comment 4 Erno Mononen 2009-07-03 19:59:27 UTC
Setting TM to 6.8, but as written before depends on ruby-debug-base.
Comment 5 mark_moseley 2009-07-27 15:29:49 UTC
ruby-debug-base has been ported to Ruby 1.9. See http://github.com/mark-moseley
Comment 6 Martin Krauskopf 2009-08-21 08:20:25 UTC
I've exchanged few emails yesterday with Mark and we will make it possible for Mark's (and possibly similar) fork to
work with NetBeans.

- Mark will ensure correct version in the fork which fits API compatibility
- I'll provide possibility to pass property for alternative ruby-debug-ide name

I've already made it work locally on my machine (seems to work nicely Mark). There is also other tweak needed in
ruby-debug-ide wrt. to 1.9.x, I'll ping you about exactly what Mark, you will need to do the same in your fork.

Otherwise this is really not NetBeans issue - fix is needed on lower layers (debug-commons, ruby-debug projects).
Changing subject to reflect what is actually needed on NB side.

Will push either today or after (offline) weekend.
Comment 7 Martin Krauskopf 2009-08-21 09:48:48 UTC
I've pushed the NetBeans part: #79aa0d4f8a16

And ruby-debug-ide part:

  http://rubyforge.org/pipermail/debug-commons-commits/2009-August/000356.html

Mark you need to update your ruby-debug-ide fork accordingly to the above commit (if localhost is used, there is some
weird problem wrt. to the connecting from Java client to Ruby server - as it is with MacOS - the workaround seems to work). 

Once you fix the version to the mentioned pattern (e.g. 0.4.7.1mm, 0.4.7, ... 0.4.x) and start NetBeans with

  -J-DrubyDebugIDEName=mark-moseley-ruby-debug-ide

parameter, the debugger should work. Let me know if you hit some problems or have any questions.
Comment 8 Quality Engineering 2009-08-21 17:53:13 UTC
Integrated into 'main-golden', will be available in build *200908211401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/79aa0d4f8a16
User: Martin Krauskopf <mkrauskopf@netbeans.org>
Log: #157870: Possibility to pass alternative ruby-debug-ide gem's name
Comment 9 mark_moseley 2009-08-22 05:12:31 UTC
The "localhost" fix works for me on Windows XP, but not on Vista x64.

"127.0.0.1" does work on Vista x64.
Comment 10 Martin Krauskopf 2009-08-24 07:21:52 UTC
Mark could you find out how RUBY_PLATFORM constant differs on Vista vs. XP and/or provide a patch for
lib/ruby-debug.rb:122 (just tweaking condition). Thanks.
Comment 11 Martin Krauskopf 2009-08-24 14:30:34 UTC
Strange. 1.8.7, i686-linux, 'localhost' combination does not work either. '127.0.0.1', nil, '' all works. I would bet
that half a year ago it worked on Ubuntu in the currently non-working configuration. Some of the mentioned component
could be a bit different. Seems to be quite unpredictable.
Comment 12 Martin Krauskopf 2009-08-24 15:15:47 UTC
Mark, could you try on your XP and Vista, whether just:

  server = host ? TCPServer.new(host, port) : TCPServer.new(port)

works. Instead of the odd condition, i.e. patch:

Index: ruby-debug.rb
===================================================================
--- ruby-debug.rb	(revision 637)
+++ ruby-debug.rb	(working copy)
@@ -119,12 +119,8 @@
       return if @control_thread
       @control_thread = DebugThread.new do
         begin
-          unless RUBY_PLATFORM =~ /darwin/i or # Mac OS X seems to have problem with 'localhost'
-                 RUBY_VERSION  =~ /1\.9\../    # Ruby 1.9.x seems to as well
-            host ||= 'localhost' # nil does not seem to work for IPv6, localhost does
-          end
           $stderr.printf "Fast Debugger (ruby-debug-ide 0.4.7) listens on #{host}:#{port}\n"
-          server = TCPServer.new(host, port)
+          server = host ? TCPServer.new(host, port) : TCPServer.new(port)
           while (session = server.accept)
             begin
               interface = RemoteInterface.new(session)

Comment 13 mark_moseley 2009-08-24 16:39:38 UTC
That works on XP but still not Vista.

Note that another variable here is IPv6. My XP box doesn't have it, but my Vista box does.

"ping localhost" on my XP pings "127.0.0.1", and on my Vista pings "::1:". 

Comment 14 Martin Krauskopf 2009-08-25 09:40:58 UTC
Mark, I've sent you .jar to try. I've problem with sending the email to your personal address (returned with server
failure), so I've send it to your @netbeans.org one. If it does not come, let me know if there is other way to contact
you. Thanks.

On the Java side I'm using:
   new Socket(InetAddress.getLocalHost(), port);

And on the Ruby side:
   TCPServer.new(port)

which I believe is correct combo.

PS: I'll try your new gems (mentioned in personal email) as well (for the case you did not get my mail message)
Comment 15 Martin Krauskopf 2009-08-25 16:29:26 UTC
Update for Mark: I've pushed one more change which makes NetBeans work with ruby-debug-ide19 automatically when running
on 1.9. I've also tried both configuration and both seems to work. So no need for -J-D<property> from user's side.

I'm a bit reluctant to provide ruby-debug-ide19 gem on debug-commons project, let's communicate through email the details.

Changeset: #d4abfc9e7a60