Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

debugger restart

15 views
Skip to first unread message

R. Mark Volkmann

unread,
May 22, 2005, 9:53:50 PM5/22/05
to
In looking through the debugger commands for "ruby -r debug {name}.rb", I don't
see a way to restart execution. It seems that you have to quit the debugger
and restart it. Is that correct?

--
R. Mark Volkmann
Partner, Object Computing, Inc.


Sam Roberts

unread,
May 23, 2005, 7:48:36 PM5/23/05
to
Quoting ma...@ociweb.com, on Mon, May 23, 2005 at 10:53:50AM +0900:
> In looking through the debugger commands for "ruby -r debug {name}.rb", I don't
> see a way to restart execution. It seems that you have to quit the debugger
> and restart it. Is that correct?

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.

Sam

Yukihiro Matsumoto

unread,
May 24, 2005, 4:24:53 AM5/24/05
to
Hi,

In message "Re: debugger restart"


on Tue, 24 May 2005 08:48:36 +0900, Sam Roberts <srob...@uniserve.com> 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


drd

unread,
Sep 20, 2012, 8:32:18 PM9/20/12
to
A simple workaround is to use:

ruby -r debug -n <prog_name>

The -n switch will wrap the program around a while loop
(see help under the debug mode).

-daniel


0 new messages