Debug.jl icon indicating copy to clipboard operation
Debug.jl copied to clipboard

Trap ERROR

Open lejon opened this issue 10 years ago • 3 comments

It would be very useful to be able to have the debugger to trap ERROR so you could inspect the stack on ERRORs.

lejon avatar Apr 08 '14 08:04 lejon

Great work putting together this debug framework btw! :)

lejon avatar Apr 08 '14 08:04 lejon

One reason that I haven't implemented this is because I'm a bit unclear on how it would work. Exceptions can occur as part of normal program execution; you can't be sure that it was a problem until you find out that the exception was uncaught. For that case, I put down some thoughts in #28.

Another possibility could be to have an option to trap on exceptions as soon as they try to unwind instrumented code. After all, exceptions are rarely used in normal control flow in Julia. Either you could always let the exception propagate, and break at each scope that it is about to leave. Or you could let the user decide to silence the exception and carry on.

What did you have in mind?

And thanks :)

toivoh avatar Apr 08 '14 09:04 toivoh

I support this request as well. Can add a parameter to @debug about which error to trap (or trap them all), and in the debugger you can just step or continue.

chtlp avatar Aug 23 '14 07:08 chtlp