Ruby 1.9.0 and the debugger

J

John Maclean

I've built Ruby 1.9 and all is well with that. With respects to using
the debugger, the README says "use rb_debug". Now does that mean
`require rb_debug` in an irb session or am I to recompile Ruby to
include support for the debugger?


irb(main):004:0> require rb_debug.rb
NameError: undefined local variable or method `rb_debug' for main:Object
from (irb):4
from /usr/local/lib/ruby/1.9.0/irb.rb:150:in `block (2 levels)
in eval_input' from /usr/local/lib/ruby/1.9.0/irb.rb:259:in
`signal_status' from /usr/local/lib/ruby/1.9.0/irb.rb:147:in `block in
eval_input' from /usr/local/lib/ruby/1.9.0/irb.rb:146:in `eval_input'
from /usr/local/lib/ruby/1.9.0/irb.rb:70:in `block in start'
from /usr/local/lib/ruby/1.9.0/irb.rb:69:in `catch'
from /usr/local/lib/ruby/1.9.0/irb.rb:69:in `start'
from /usr/local/bin/irb:13:in `<main>'

I've tried to find some docs on this via ri debug:-

More than one method matched your request. You can refine
your search by asking for information on one of:

IRB::Context#debug_level=, IRB::Context#debug?, Logger#debug,
Logger#debug?, Net::SMTP#debug_output=, Net::SMTP#set_debug_output,
Net::HTTP#set_debug_output, Net::pOP3#set_debug_output,
Net::IMAP::debug=, Net::IMAP::debug, DEBUGGER__::debug_thread_info,
DEBUGGER__#debug_silent_eval, DEBUGGER__#debug_variable_info,
DEBUGGER__#debug_funcname, DEBUGGER__#debug_eval,
DEBUGGER__#debug_method_info, DEBUGGER__#debug_command,
DEBUGGER__#debug_print_help, WEBrick::BasicLog#debug,
WEBrick::BasicLog#debug?, Shell::debug=, Shell#debug=,
RubyLex::debug?, Ripper#yydebug=, Ripper#yydebug

Regards,

John Maclean
MSc (DIC)
+44 7739 171 531
 
F

fedzor

I've built Ruby 1.9 and all is well with that. With respects to using
the debugger, the README says "use rb_debug". Now does that mean
`require rb_debug` in an irb session or am I to recompile Ruby to
include support for the debugger?


irb(main):004:0> require rb_debug.rb
NameError: undefined local variable or method `rb_debug' for
main:Object

require "rb_debug.rb"

You need to have the quotes around it, because it takes a String :)

HTH,
Ari
 
O

Ollivier Robert

I've built Ruby 1.9 and all is well with that. With respects to using
the debugger, the README says "use rb_debug". Now does that mean
`require rb_debug` in an irb session or am I to recompile Ruby to
include support for the debugger?


irb(main):004:0> require rb_debug.rb
NameError: undefined local variable or method `rb_debug' for main:Object
from (irb):4
from /usr/local/lib/ruby/1.9.0/irb.rb:150:in `block (2 levels)
in eval_input' from /usr/local/lib/ruby/1.9.0/irb.rb:259:in
`signal_status' from /usr/local/lib/ruby/1.9.0/irb.rb:147:in `block in
eval_input' from /usr/local/lib/ruby/1.9.0/irb.rb:146:in `eval_input'
from /usr/local/lib/ruby/1.9.0/irb.rb:70:in `block in start'
from /usr/local/lib/ruby/1.9.0/irb.rb:69:in `catch'
from /usr/local/lib/ruby/1.9.0/irb.rb:69:in `start'
from /usr/local/bin/irb:13:in `<main>'

I've tried to find some docs on this via ri debug:-

More than one method matched your request. You can refine
your search by asking for information on one of:

IRB::Context#debug_level=, IRB::Context#debug?, Logger#debug,
Logger#debug?, Net::SMTP#debug_output=, Net::SMTP#set_debug_output,
Net::HTTP#set_debug_output, Net::pOP3#set_debug_output,
Net::IMAP::debug=, Net::IMAP::debug, DEBUGGER__::debug_thread_info,
DEBUGGER__#debug_silent_eval, DEBUGGER__#debug_variable_info,
DEBUGGER__#debug_funcname, DEBUGGER__#debug_eval,
DEBUGGER__#debug_method_info, DEBUGGER__#debug_command,
DEBUGGER__#debug_print_help, WEBrick::BasicLog#debug,
WEBrick::BasicLog#debug?, Shell::debug=, Shell#debug=,
RubyLex::debug?, Ripper#yydebug=, Ripper#yydebug

Regards,

John Maclean
MSc (DIC)
+44 7739 171 531
 
R

Roger Pack

John said:
I've built Ruby 1.9 and all is well with that. With respects to using
the debugger, the README says "use rb_debug". Now does that mean
`require rb_debug` in an irb session or am I to recompile Ruby to
include support for the debugger?

Ahh. For some reason I thought that since ruby-debug didn't work with
1.9 [yet] that there was no debugger for 1.9. But apparently there
is--the default built-in [albeit slow] one. Silly me.

Note also that there's "ruby unroller" if anybody wants to see the trace
of their program executing:
http://unroller.rubyforge.org/

i.e.
| | | call_one
| | | | return 3
| | | more stuff

Cheers.
-=r
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Ruby 1.9.0 and Mechanize 0
each, stuck up... 2
Ruby 1.9, YAML & encodings 0
:IRB Bug 1
Ruby 1.9 named arguments 5
Strange bug in irb1.9 7
Problem on an example from ruby-lang.org 1
Ruby 1.9.0 warnings 1

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top