Debugger problem in 1.9?

My first attempt to move to ruby 1.9, and it’s not going well.

I need the debugger. I usually use the ruby-debug gem, but that’s
inexplicably not working in 1.9 - won’t install.

So and now I’m invoking the debugger from the command line - and I’m
getting behavior I’ve never seen before. Basically, it’s not obeying
elementary commands. I ask it to run to a specific line, and it stops in
some obscure library, which is of no use to me. Example:

===
tomc@tomc-desktop:~/Ruby-work/setnet/bin$ ruby1.9 -r debug ./setnet
Debug.rb
Emacs support available.

./setnet:7:$: << ‘…/lib/setnet’ << ‘…’
(rdb:1) n 15
/usr/lib/ruby/1.9.0/thread.rb:242:class SizedQueue < Queue
(rdb:1) l
[237, 246] in /usr/lib/ruby/1.9.0/thread.rb
237 # This class represents queues of specified size capacity. The
push operation
238 # may be blocked if the capacity is full.
239 #
240 # See Queue for an example of how a SizedQueue works.
241 #
=> 242 class SizedQueue < Queue
243 #
244 # Creates a fixed-length queue with a maximum size of +max+.
245 #
246 def initialize(max)
(rdb:1)

This is nonsense. I said to run to line 15, and it stops at line 242 in
thread.rb - and what THAT is I have no idea. Certainly not MY code. I
don’t even know where I am in my code, at this point. This is worse than
useless.

I’m at sea here, as I’ve never seen this sort of thing happen with the
debugger. Rather, I’ve used it very extensively and to good effect, in
its ruby-debug form. I’ve tried a number of things to puzzle this
current problem out, and none are working. Without a working debugger, I
will have to abandon 1.9.

Any ideas to get this working?

Thanks in advance,

Tom

Tom C. wrote:

My first attempt to move to ruby 1.9, and it’s not going well.

I need the debugger. I usually use the ruby-debug gem, but that’s
inexplicably not working in 1.9 - won’t install.

So and now I’m invoking the debugger from the command line - and I’m
getting behavior I’ve never seen before. Basically, it’s not obeying
elementary commands. I ask it to run to a specific line, and it stops in
some obscure library, which is of no use to me. Example:

Since the debugger you’re using is written in ruby, you could try to
hack the code and see if you can fix a bug [it might be just that the
line is being optimized out, though, see also a few trace related bugs
on ruby core].
Anyway the good news is you can use ruby-debug with 1.9 now.

=r