#include <cstdlib>
#include <iostream>
#include <new>
#include <sys/types.h>
#include <unistd.h>
#include "cmd-edit.h"
#include "oct-syscalls.h"
#include "quit.h"
#include "singleton-cleanup.h"
#include "debug.h"
#include "defun.h"
#include "error.h"
#include "input.h"
#include "load-save.h"
#include "oct-map.h"
#include "pager.h"
#include "pt-bp.h"
#include "pt-eval.h"
#include "sighandlers.h"
#include "sysdep.h"
#include "syswait.h"
#include "toplev.h"
#include "utils.h"
#include "variables.h"
Go to the source code of this file.
Classes | |
class | pid_equal |
Defines | |
#define | BADSIG (void (*)(int))-1 |
#define | BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar) |
#define | BLOCK_SIGNAL(sig, nvar, ovar) |
#define | OCL_REP octave_child_list::octave_child_list_rep |
#define | UNBLOCK_CHILD(ovar) GNULIB_NAMESPACE::sigprocmask (SIG_SETMASK, &ovar, 0) |
Functions | |
DEFUN (SIG, args,,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} SIG ()\n\ Return a structure containing Unix signal names and their defined values.\n\ @end deftypefn") | |
DEFUN (sigterm_dumps_octave_core, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} sigterm_dumps_octave_core ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} sigterm_dumps_octave_core (@var{new_val})\n\ @deftypefnx {Built-in Function} {} sigterm_dumps_octave_core (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether Octave tries\n\ to save all current variables to the file \"octave-core\" if it receives\n\ a terminate signal.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @end deftypefn") | |
DEFUN (debug_on_interrupt, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} debug_on_interrupt ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} debug_on_interrupt (@var{new_val})\n\ @deftypefnx {Built-in Function} {} debug_on_interrupt (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether Octave will try\n\ to enter debugging mode when it receives an interrupt signal (typically\n\ generated with @kbd{C-c}). If a second interrupt signal is received\n\ before reaching the debugging mode, a normal interrupt will occur.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @seealso{debug_on_error, debug_on_warning}\n\ @end deftypefn") | |
DEFUN (sighup_dumps_octave_core, args, nargout,"-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} sighup_dumps_octave_core ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} sighup_dumps_octave_core (@var{new_val})\n\ @deftypefnx {Built-in Function} {} sighup_dumps_octave_core (@var{new_val}, \"local\")\n\ Query or set the internal variable that controls whether Octave tries\n\ to save all current variables to the file \"octave-core\" if it receives\n\ a hangup signal.\n\ \n\ When called from inside a function with the \"local\" option, the variable is\n\ changed locally for the function and any subroutines it calls. The original\n\ variable value is restored when exiting the function.\n\ @end deftypefn") | |
static void | generic_sig_handler (int sig) |
void | install_signal_handlers (void) |
static octave_scalar_map | make_sig_struct (void) |
static void | my_friendly_exit (const char *sig_name, int sig_number, bool save_vars=true) |
octave_interrupt_handler | octave_catch_interrupts (void) |
octave_interrupt_handler | octave_ignore_interrupts (void) |
octave_interrupt_handler | octave_set_interrupt_handler (const volatile octave_interrupt_handler &h, bool restart_syscalls) |
sig_handler * | octave_set_signal_handler (int sig, sig_handler *handler, bool restart_syscalls) |
void | octave_signal_handler (void) |
static void | sigint_handler (int sig) |
static void | user_abort (const char *sig_name, int sig_number) |
Variables | |
bool | can_interrupt = false |
static bool | octave_signals_caught [NSIG] |
int | pipe_handler_error_count = 0 |
static bool | Vdebug_on_interrupt = false |
static bool | Vsighup_dumps_octave_core = true |
static bool | Vsigterm_dumps_octave_core = true |
#define BADSIG (void (*)(int))-1 |
Definition at line 79 of file sighandlers.cc.
#define BLOCK_CHILD | ( | nvar, | ||
ovar | ||||
) | BLOCK_SIGNAL (SIGCHLD, nvar, ovar) |
Definition at line 108 of file sighandlers.cc.
Referenced by octave_signal_handler().
#define BLOCK_SIGNAL | ( | sig, | ||
nvar, | ||||
ovar | ||||
) |
do \ { \ GNULIB_NAMESPACE::sigemptyset (&nvar); \ GNULIB_NAMESPACE::sigaddset (&nvar, sig); \ GNULIB_NAMESPACE::sigemptyset (&ovar); \ GNULIB_NAMESPACE::sigprocmask (SIG_BLOCK, &nvar, &ovar); \ } \ while (0)
Definition at line 94 of file sighandlers.cc.
#define OCL_REP octave_child_list::octave_child_list_rep |
Definition at line 870 of file sighandlers.cc.
#define UNBLOCK_CHILD | ( | ovar | ) | GNULIB_NAMESPACE::sigprocmask (SIG_SETMASK, &ovar, 0) |
Definition at line 109 of file sighandlers.cc.
Referenced by octave_signal_handler().
DEFUN | ( | SIG | , | |
args | ||||
) |
Definition at line 939 of file sighandlers.cc.
References make_sig_struct(), and print_usage().
DEFUN | ( | sigterm_dumps_octave_core | , | |
args | , | |||
nargout | ||||
) |
Definition at line 1023 of file sighandlers.cc.
References SET_INTERNAL_VARIABLE.
DEFUN | ( | debug_on_interrupt | , | |
args | , | |||
nargout | ||||
) |
Definition at line 965 of file sighandlers.cc.
References SET_INTERNAL_VARIABLE.
DEFUN | ( | sighup_dumps_octave_core | , | |
args | , | |||
nargout | ||||
) |
Definition at line 995 of file sighandlers.cc.
References SET_INTERNAL_VARIABLE.
static void generic_sig_handler | ( | int | sig | ) | [static] |
Definition at line 240 of file sighandlers.cc.
References my_friendly_exit(), and strsignal().
Referenced by install_signal_handlers().
void install_signal_handlers | ( | void | ) |
Definition at line 530 of file sighandlers.cc.
References generic_sig_handler(), octave_catch_interrupts(), octave_set_signal_handler(), and octave_signals_caught.
Referenced by octave_main().
static octave_scalar_map make_sig_struct | ( | void | ) | [static] |
Definition at line 658 of file sighandlers.cc.
References octave_scalar_map::assign().
Referenced by DEFUN().
static void my_friendly_exit | ( | const char * | sig_name, | |
int | sig_number, | |||
bool | save_vars = true | |||
) | [static] |
Definition at line 164 of file sighandlers.cc.
References dump_octave_core(), MINGW_SIGNAL_CLEANUP, octave_set_signal_handler(), and save_vars().
Referenced by generic_sig_handler(), and user_abort().
octave_interrupt_handler octave_catch_interrupts | ( | void | ) |
Definition at line 461 of file sighandlers.cc.
References error(), octave_set_signal_handler(), sigint_handler(), and w32_set_quiet_shutdown().
Referenced by execute_command_line_file(), execute_eval_option_code(), install_signal_handlers(), main_loop(), and recover_from_exception().
octave_interrupt_handler octave_ignore_interrupts | ( | void | ) |
Definition at line 493 of file sighandlers.cc.
References octave_set_signal_handler().
Referenced by do_edit_history(), octave_kbhit(), and octave_signal_handler().
octave_interrupt_handler octave_set_interrupt_handler | ( | const volatile octave_interrupt_handler & | h, | |
bool | restart_syscalls | |||
) |
Definition at line 509 of file sighandlers.cc.
References octave_set_signal_handler().
Referenced by do_edit_history(), octave_kbhit(), and octave_signal_handler().
sig_handler* octave_set_signal_handler | ( | int | sig, | |
sig_handler * | handler, | |||
bool | restart_syscalls | |||
) |
Definition at line 206 of file sighandlers.cc.
Referenced by install_signal_handlers(), my_friendly_exit(), octave_catch_interrupts(), octave_ignore_interrupts(), and octave_set_interrupt_handler().
void octave_signal_handler | ( | void | ) |
Definition at line 115 of file sighandlers.cc.
References BLOCK_CHILD, octave_ignore_interrupts(), octave_set_interrupt_handler(), octave_signals_caught, octave_child_list::reap(), UNBLOCK_CHILD, and octave_child_list::wait().
static void sigint_handler | ( | int | sig | ) | [static] |
Definition at line 379 of file sighandlers.cc.
References strsignal(), and user_abort().
Referenced by octave_catch_interrupts().
Definition at line 323 of file sighandlers.cc.
References can_interrupt, tree_evaluator::debug_mode, bp_table::have_breakpoints(), interactive, my_friendly_exit(), octave_debug_on_interrupt_state, octave_initialized, octave_interrupt_immediately, octave_interrupt_state, octave_jump_to_enclosing_context(), octave_signal_caught, Vdebug_on_interrupt, and Vdebugging.
Referenced by sigint_handler().
bool can_interrupt = false |
Definition at line 61 of file sighandlers.cc.
Referenced by execute_command_line_file(), execute_eval_option_code(), main_loop(), recover_from_exception(), and user_abort().
bool octave_signals_caught[NSIG] [static] |
Definition at line 75 of file sighandlers.cc.
Referenced by install_signal_handlers(), and octave_signal_handler().
Definition at line 58 of file sighandlers.cc.
Referenced by octave_gets().
bool Vdebug_on_interrupt = false [static] |
Definition at line 64 of file sighandlers.cc.
Referenced by user_abort().
bool Vsighup_dumps_octave_core = true [static] |
Definition at line 69 of file sighandlers.cc.
bool Vsigterm_dumps_octave_core = true [static] |
Definition at line 72 of file sighandlers.cc.