W3cubDocs

/Octave

13.1 Entering Debug Mode

There are two basic means of interrupting the execution of an Octave script. These are breakpoints (see Breakpoints), discussed in the next section, and interruption based on some condition.

Octave supports three means to stop execution based on the values set in the functions debug_on_interrupt, debug_on_warning, and debug_on_error.

val = debug_on_interrupt ()
old_val = debug_on_interrupt (new_val)
debug_on_interrupt (new_val, "local")

Query or set the internal variable that controls whether Octave will try to enter debugging mode when it receives an interrupt signal (typically generated with C-c).

If a second interrupt signal is received before reaching the debugging mode, a normal interrupt will occur.

When called from inside a function with the "local" option, the variable is changed locally for the function and any subroutines it calls. The original variable value is restored when exiting the function.

See also: debug_on_error, debug_on_warning.

val = debug_on_warning ()
old_val = debug_on_warning (new_val)
debug_on_warning (new_val, "local")

Query or set the internal variable that controls whether Octave will try to enter the debugger when a warning is encountered.

When called from inside a function with the "local" option, the variable is changed locally for the function and any subroutines it calls. The original variable value is restored when exiting the function.

See also: debug_on_error, debug_on_interrupt.

val = debug_on_error ()
old_val = debug_on_error (new_val)
debug_on_error (new_val, "local")

Query or set the internal variable that controls whether Octave will try to enter the debugger when an error is encountered.

This will also inhibit printing of the normal traceback message (you will only see the top-level error message).

When called from inside a function with the "local" option, the variable is changed locally for the function and any subroutines it calls. The original variable value is restored when exiting the function.

See also: debug_on_warning, debug_on_interrupt.

© 1996–2018 John W. Eaton
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://octave.org/doc/interpreter/Entering-Debug-Mode.html