[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

debugger restart

R. Mark Volkmann

5/23/2005 1:54:00 AM

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.


2 Answers

Sam Roberts

5/23/2005 11:49:00 PM

0

Quoting mark@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

5/24/2005 8:25:00 AM

0

Hi,

In message "Re: debugger restart"
on Tue, 24 May 2005 08:48:36 +0900, Sam Roberts <sroberts@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