I'm happy to announce that ruby-debug 0.7 is available now.
This is mostly a bugfix release. It also has many internal changes that greatly improve the debugger performance. It is so much faster now, that sometime I don't even notice that I'm using it when I start mongrel with rdebug script. The list of changes includes:
Frameclass has been removed and instead a preallocated block of memory is used to keep frames information. This change has decreased the number of object being created.- Another major change involves the fact that the debugger by default doesn't create Binding object for each frame. This is a very expensive operation and it's been the major source of performance problems. Instead, ruby-debug keeps references to the live Ruby's data structures that store information about the local context (ruby_scope). It's still possible to restore the old behavior by using
--keep-frame-bindingoption, orDebugger.keep_frame_binding = true. - New set command has been introduced. You can use
help setcommand to see what options are available.
Enjoy, and please report any problem you find!
Cool! Just tried it and it works...! That's what i was looking for, thank you!
And here are few issues i've noticed so far. 1.help command(inside debugger console) produces list of commands without any descriptions... 2.I cannot delete breakpoints i set.
gmarik,
Use
help <command>to get the information regarding an individual command.Use
delete <bkp_num>to delete a breakpointThere are two ways around it:
-woption when you run ruby-debug in the remote mode. This way when you connect your client, you'll get a chance to set up your breakpoints.While ruby-debug is running, you can connect to the control thread using telnet and you get access to a limited number of commands, e.g.
$ telnet localhost 8990
Under what situations might we want to use --keep-frame-binding?
THat's what i get trying to delete breakpoints. What am i doing wrong? $ rdebug -c Connected. ./script/server:2: require File.dirname(FILE) + '/../config/boot' (rdb:1) b No breakpoints (rdb:1) b StoreController.find_cart Set breakpoint 1 at StoreController:find_cart (rdb:1) b Breakpoints: 1 StoreController:find_cart (rdb:1) del 1 Adjusting would put us beyond the newest (innermost) frame. (rdb:1) delete 1 Adjusting would put us beyond the newest (innermost) frame. (rdb:1) b Breakpoints: 1 StoreController:find_cart (rdb:1) Thanks!
Evan,
The explanation requires some knowledge of the debugger's internal structure. When a new frame is created, instead of capturing a real Binding (using
Kernel#binding), the following information is being collected: the currentselfobject and a hash of locals variables (similar toKernel#local_variablels).Now, when you use
evalcommand, an artificial binding is created using this information. This binding is retrieved fromself.instance_evalwith the propagation of local variables.In most cases everything works as expected, but if you see that
evalgives you an unexpected result, you probably should resort to--keep-frame-binding. Notice that in this case ruby-debug will slow down your application considerably (at least 6 times).gmarik,
I can't reproduce it, but I think I know where the problem is. I've just pushed a new version to rubyforge. It'll take some time to propagate to servers though.
Thanks
Kent, It works now! Thanks!
Hey Kent,
So i just upgraded to 0.7 and it seems like eval is now broken.
(rdb:1) e on Exception NameError: undefined local variable or method
on' for #<ArticleTest:0x335d024> (rdb:1) eval on Exception NameError: undefined local variable or methodon' for #<articletest:0x335d024> (rdb:1)Getting eval working for me was a major bonus for using ruby-debug. It gave ruby-debug the best of both the breakpointer / console world and of the traditional debugger. Am i the only one with it broken?
Hey rabble,
This is exactly the case where you want to start
rdebugwith--keep-frame-bindingoption, orDebugger.keep_frame_binding = trueif you requireruby-debugexplicitly in your code.Also you can try the new build 0.7.3 that I've just uploaded to rubyforge where I've fixed several critical bugs and one of them is related to this issue.
Let me know if it works for you.
is there a way to set the settings initial on every rdebug start?
everytime i start rdebug i have to hack: 'set autoeval', 'set autolist', 'r on' into the keyboard. how to load this commands initial?
automtic reload seems not to work? isn't it? or when is the code reloaded? after a manual 'r' the code is reloaded. but only with sending the 'r' command, nowhere automatically.
regards
pantarhei,
The reload issue will be fixed in the next version. Also you will be able to specify the initial
setcommands in your~/.rdebugrcfile.thank you kent. but how to set it in the file? trying the commands 'set autolist' will result in an error.
trying to set: 'autoeval=true' 'autolist=true'
rdebug starts. but none of the commands is executed.
'autolist=1' also fails with no result.
am i too stupid or what is going wrong here?
btw, i'm on windows if this is interesting.
regards
pantarhei,
It works only starting with version 0.7.5
Make sure you have the latest installed.
now it works.. ;)
thank you so much! great work!
regards
@x: Please, submit bug reports to http://rubyforge.org/tracker/?group_id=1900
ruby and ruby-debug versions and a small test case that reproduces this bug would be welcome too.
I'm runny RoR under Cygwin. I installed ruby-debug with gem install ruby-debug and choose: option 1: 1. ruby-debug 0.7.5 (mswin32)
It itsalled without errors, but when I try running rdebug script/server, the following error is reported:
$ rdebug script/server /usr/lib/ruby/gems/1.8/gems/ruby-debug-0.7.5-mswin32/lib/rubydebug.so: Permission denied - /usr/lib/ruby/gems/1.8/gems/ruby-debug-0.7.5-mswin32/lib/rubydebug.so (LoadError) from /usr/lib/ruby/siteruby/1.8/rubygems/customrequire.rb:32:in
require' from /usr/lib/ruby/gems/1.8/gems/ruby-debug-0.7.5-mswin32/lib/ruby-debug.rb:5 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:ingemoriginalrequire' from /usr/lib/ruby/siteruby/1.8/rubygems/customrequire.rb:32:inrequire' from /usr/lib/ruby/gems/1.8/gems/ruby-debug-0.7.5-mswin32/bin/rdebug:6 from /usr/bin/rdebug:16:inload' from /usr/bin/rdebug:16anyone have any ideas? I've speat about 8 hours searching with google, but with no solution.
after adding execute permissions to ruby_debug.so with the following cmd: chmod 755 /usr/lib/ruby/gems/1.8/gems/ruby-debug-0.7.5-mswin32/lib/ruby_debug.so
I now get the following error:
/usr/lib/ruby/gems/1.8/gems/ruby-debug-0.7.5-mswin32/lib/rubydebug.so: No such file or directory - /usr/lib/ruby/gems/1.8/gems/ruby-debug-0.7.5-mswin32/lib/rubydebug.so (LoadError)
I've now hit a brick wall.
Anyone have any ideas? paul@carewcontact.com Thanks
Ruby-debug is awesome. I recently upgraded to 1.8.5 and hit the breakpointer problem for the first time today. Initially I was pretty bummed, but now I'm very excited about 1.8.5 breaking breakpointer because it lead to find and install ruby_debug. This is a far superior solution! Excellent work and thank you very much!
Hey Steve,
Thank you for your support!
Hi I notice that ruby 1.8.6/rails 1.2.3 is out ---- is ruby_debug compatible ?
weepy - not sure about 1.8.6, but i'm running 1.8.5/1.2.3 with no problems.
weepy,
ruby-debug should be working fine with ruby 1.8.6