changeset 24583:466e2aab871b

stay in debug mode on Control-C interrupts (bug #52750) * pt-eval.cc (tree_evaluator::visit_statement): Catch octave::interrupt_exception. If in debug mode, recover and continue in debug mode. Otherwise, rethrow exception.
author John W. Eaton <jwe@octave.org>
date Wed, 10 Jan 2018 15:41:47 -0500
parents 50545190a604
children 7a18e02a516e
files libinterp/parse-tree/pt-eval.cc
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/pt-eval.cc	Wed Jan 10 15:31:23 2018 +0100
+++ b/libinterp/parse-tree/pt-eval.cc	Wed Jan 10 15:41:47 2018 -0500
@@ -2329,6 +2329,16 @@
             error_with_id ("Octave:bad-alloc",
                            "out of memory or dimension too large for Octave's index type");
           }
+        catch (const octave::interrupt_exception&)
+          {
+            // If we are debugging, then continue with next statement.
+            // Otherwise, jump out of here.
+
+            if (debug_mode)
+              interpreter::recover_from_exception ();
+            else
+              throw;
+          }
       }
   }