debugger restart

R

R. Mark Volkmann

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?
 
S

Sam Roberts

Quoting (e-mail address removed), 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
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: debugger restart"

|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
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top