Ruby Debugger. Remove catchpoint?

D

David Corbin

Is there someway to remove a catchpoint while in the debugger? Better yet, is
there a way to fix it so it doesn't default to catching StandardError?

David

P.S. what about a way to restart the "program under debug", without restarting
the debugger?
 
L

Lothar Scholz

Hello David,

DC> P.S. what about a way to restart the "program under debug", without restarting
DC> the debugger?

Sorry, what you mean with this. Do you mean to reload the source files
you that changed since starting the program so that you can have an
"edit and continue" operation in the debugger ?
 
A

Assaph Mehr

David said:
Is there someway to remove a catchpoint while in the debugger? Better yet, is
there a way to fix it so it doesn't default to catching
StandardError?

Use 'catch off'
P.S. what about a way to restart the "program under debug", without restarting
the debugger?

Do you mean start again from the top? No way that I know of, and
considering the effort it'll take to bring everything to the state it
was before the program started (class definitions, redefinitions,
globals, threads etc) I doubt it's any better than just restarting the
debugger and setting a breakpoint.

BTW, I find unit-tests plus the occasional application of breakpoint
(http://ruby-breakpoint.rubyforge.org, available as a gem) much better
than traditional debugging, both immediately and in the long run.

HTH,
Assaph
 
S

Stephen Kellett

Lothar Scholz said:
Hello David,

DC> P.S. what about a way to restart the "program under debug", without
DC>restarting
DC> the debugger?

Sorry, what you mean with this.

I think he means restart the program, as from the beginning without
having to drop out of the debugger. You can do this with a single
buttonpress or mouse click when working with the Microsoft Visual Studio
debugger (thats my guess where the idea comes from).

Its very useful when you realise what you did wrong in the current
debugging session and want to start over again without explicitly
killing the current process and starting a new debugger (the restart
does all those things for you, except the debugger is the same debugger
process with the same breakpoints, watchpoints etc).

Imagine in getting in your car and going for a journey and then pressing
the restart button. You begin again from the parking lot just like you
did 10 minutes ago...

Stephen
 
L

Lothar Scholz

Hello Stephen,


SK> Its very useful when you realise what you did wrong in the current
SK> debugging session and want to start over again without explicitly
SK> killing the current process and starting a new debugger (the restart
SK> does all those things for you, except the debugger is the same debugger
SK> process with the same breakpoints, watchpoints etc).

Wow, does "ruby -rdebug" really not offer this feature ?
Thinking about setting breakpoints by typeing filename, linenumber
every time ..... :-(
 
D

David Corbin

I think he means restart the program, as from the beginning without
having to drop out of the debugger. You can do this with a single
buttonpress or mouse click when working with the Microsoft Visual Studio
debugger (thats my guess where the idea comes from).

Eeew. No, the idea came from Perl.
 
D

David Corbin

Do you mean start again from the top?
Yes

No way that I know of, and
considering the effort it'll take to bring everything to the state it
was before the program started (class definitions, redefinitions,
globals, threads etc) I doubt it's any better than just restarting the
debugger and setting a breakpoint.

Except it's lots of typing for me. Especially if I have a lot of breakpoints.
And I have a hard time leaving the debugger because of the stupid "Really
quit?" (My fingers just have not learned to say Y. I find myself looping
through that 2 or 3 times everytime I want to stop the debugger.
BTW, I find unit-tests plus the occasional application of breakpoint
(http://ruby-breakpoint.rubyforge.org, available as a gem) much better
than traditional debugging, both immediately and in the long run.

I'm a big fan of unit tests, and I continue to strive to write better smaller
ones, but I have yet to reach the 'mythical' point where a debugger is not
helpful. As for breakpoint, maybe I have to adapt, but not being able to
step through code is just not the same.
 

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

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top