From: Yukihiro Matsumoto Date: 2005-05-24T17:24:53+09:00 Subject: Re: debugger restart Hi, In message "Re: debugger restart" on Tue, 24 May 2005 08:48:36 +0900, Sam Roberts writes: |As far as I have been able to tell. Its a huge PITA, isn't it? You get |all your breakpoints and everything set up, then skip past your bug, and |have to do it all over again. | |Writing the debugger in ruby is cool, but appears to have some |downsides. Does this small patch helps you? The r (restart) command moves you back to the beginning. And at the script termination, it goes back to the start as well, unless you specify q (quit) command. --- lib/debug.rb 6 Dec 2004 15:31:25 -0000 1.54 +++ lib/debug.rb 24 May 2005 08:18:39 -0000 @@ -257,2 +257,8 @@ class Context MUTEX.lock + unless $debugger_restart + callcc{|c| $debugger_restart = c} + at_exit { + $debugger_restart.call + } + end set_last_thread(Thread.current) @@ -525,2 +531,5 @@ class Context stdout.printf "%s\n", debug_eval($', binding).inspect + + when /^\s*r(?:estart)?$/ + $debugger_restart.call