17d62b00eSchristos /* Target signal translation functions for GDB. 2*6881a400Schristos Copyright (C) 1990-2023 Free Software Foundation, Inc. 37d62b00eSchristos Contributed by Cygnus Support. 47d62b00eSchristos 57d62b00eSchristos This file is part of GDB. 67d62b00eSchristos 77d62b00eSchristos This program is free software; you can redistribute it and/or modify 87d62b00eSchristos it under the terms of the GNU General Public License as published by 97d62b00eSchristos the Free Software Foundation; either version 3 of the License, or 107d62b00eSchristos (at your option) any later version. 117d62b00eSchristos 127d62b00eSchristos This program is distributed in the hope that it will be useful, 137d62b00eSchristos but WITHOUT ANY WARRANTY; without even the implied warranty of 147d62b00eSchristos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 157d62b00eSchristos GNU General Public License for more details. 167d62b00eSchristos 177d62b00eSchristos You should have received a copy of the GNU General Public License 187d62b00eSchristos along with this program. If not, see <http://www.gnu.org/licenses/>. */ 197d62b00eSchristos 207d62b00eSchristos #ifndef COMMON_GDB_SIGNALS_H 217d62b00eSchristos #define COMMON_GDB_SIGNALS_H 227d62b00eSchristos 237d62b00eSchristos #include "gdb/signals.h" 247d62b00eSchristos 257d62b00eSchristos /* Predicate to gdb_signal_to_host(). Return non-zero if the enum 267d62b00eSchristos targ_signal SIGNO has an equivalent ``host'' representation. */ 277d62b00eSchristos /* FIXME: cagney/1999-11-22: The name below was chosen in preference 287d62b00eSchristos to the shorter gdb_signal_p() because it is far less ambigious. 297d62b00eSchristos In this context ``gdb_signal'' refers to GDB's internal 307d62b00eSchristos representation of the target's set of signals while ``host signal'' 317d62b00eSchristos refers to the target operating system's signal. Confused? */ 327d62b00eSchristos extern int gdb_signal_to_host_p (enum gdb_signal signo); 337d62b00eSchristos 347d62b00eSchristos /* Convert between host signal numbers and enum gdb_signal's. 357d62b00eSchristos gdb_signal_to_host() returns 0 and prints a warning() on GDB's 367d62b00eSchristos console if SIGNO has no equivalent host representation. */ 377d62b00eSchristos /* FIXME: cagney/1999-11-22: Here ``host'' is used incorrectly, it is 387d62b00eSchristos refering to the target operating system's signal numbering. 397d62b00eSchristos Similarly, ``enum gdb_signal'' is named incorrectly, ``enum 407d62b00eSchristos gdb_signal'' would probably be better as it is refering to GDB's 417d62b00eSchristos internal representation of a target operating system's signal. */ 427d62b00eSchristos extern enum gdb_signal gdb_signal_from_host (int); 437d62b00eSchristos extern int gdb_signal_to_host (enum gdb_signal); 447d62b00eSchristos 457d62b00eSchristos /* Return the enum symbol name of SIG as a string, to use in debug 467d62b00eSchristos output. */ 477d62b00eSchristos extern const char *gdb_signal_to_symbol_string (enum gdb_signal sig); 487d62b00eSchristos 497d62b00eSchristos /* Return the string for a signal. */ 507d62b00eSchristos extern const char *gdb_signal_to_string (enum gdb_signal); 517d62b00eSchristos 527d62b00eSchristos /* Return the name (SIGHUP, etc.) for a signal. */ 537d62b00eSchristos extern const char *gdb_signal_to_name (enum gdb_signal); 547d62b00eSchristos 557d62b00eSchristos /* Given a name (SIGHUP, etc.), return its signal. */ 567d62b00eSchristos enum gdb_signal gdb_signal_from_name (const char *); 577d62b00eSchristos 587d62b00eSchristos #endif /* COMMON_GDB_SIGNALS_H */ 59