octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can no longer dbcont after error


From: John W. Eaton
Subject: Re: Can no longer dbcont after error
Date: Wed, 02 Dec 2015 15:50:36 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0

On 12/02/2015 12:40 PM, John W. Eaton wrote:
On 12/02/2015 12:54 AM, LachlanA wrote:
Greetings all,

I usually run with  debug_on_error(1).  It used to be possible to  dbcont
after an error (usually also continuing through a string of consequent
errors), which was extremely useful.  In my case, I load and
pre-process a
big chunk of data, and then process each record independently.  Even
though
the iteration with the error will be corrupted, I could continue
through the
other data looking for more bugs without redoing all of the
pre-processing.

It seems dbcont no longer works after an error (like it doesn't on
Matlab).
I have two questions:

a) Is that likely to be a consequence of using exceptions to handle
errors?
b) If so, would it be possible to restore the ability to continue?
Obviously the continuation would have skipped the execution of some code,
but even given that, it is useful to be able to continue from the next
statement.

If people agree that the old behaviour should be restored, but no-one
knows
off hand how to, I'll add that to my to-do list :)

The change was not intentional, but neither was the previous behavior.

If you stop in the debugger at the point of an error, I think continuing
should execute as if you had simply temporarily stopped at the point of
the error so then the exception should be thrown and you should end up
at the top level, not at the next statement in a .m file or wherever.

Oh, I also noticed that the behavior is different depending on whether the error happens inside a .m file or in a library function. That's because if the debug path is chosen an exception is not thrown. But I think it should be. So instead of something like

  if (conditions_are_right_to_allow_debugging)
    do_keyboard (...);
  else
    throw e;

we should probably just be doing

  if (conditions_are_right_to_allow_debugging)
    do_keyboard (...);

  throw e;

That's still not the way things used to work, but I think it is how they should be working.

It may be difficult to restore the behavior to exactly what it was before because of the way error_state was handled internally compared to the way exceptions behave now. If you really want to try this, then go ahead. Make it optional behavior that is disabled by default and I'll consider the patch.

jwe





reply via email to

[Prev in Thread] Current Thread [Next in Thread]