1 /* Copyright (C) 2016-2023 Free Software Foundation, Inc. 2 3 This file is part of GDB. 4 5 This program is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 17 18 #ifndef COMMON_SIGNALS_STATE_SAVE_RESTORE_H 19 #define COMMON_SIGNALS_STATE_SAVE_RESTORE_H 20 21 /* Save/restore the signal actions of all signals, and the signal 22 mask. 23 24 Since the exec family of functions does not reset the signal 25 disposition of signals set to SIG_IGN, nor does it reset the signal 26 mask, in order to be transparent, when spawning new child processes 27 to debug (with "run", etc.), we must reset signal actions and mask 28 back to what was originally inherited from gdb/gdbserver's parent, 29 just before execing the target program to debug. */ 30 31 /* Save the signal state of all signals. If !QUIET, warn if we detect 32 a custom signal handler preinstalled. */ 33 34 extern void save_original_signals_state (bool quiet); 35 36 /* Restore the signal state of all signals. */ 37 38 extern void restore_original_signals_state (void); 39 40 #endif /* COMMON_SIGNALS_STATE_SAVE_RESTORE_H */ 41