1*1424dfb3Schristos /* Target signal translation functions for GDB.
2*1424dfb3Schristos    Copyright (C) 1990-2020 Free Software Foundation, Inc.
3*1424dfb3Schristos    Contributed by Cygnus Support.
4*1424dfb3Schristos 
5*1424dfb3Schristos    This file is part of GDB.
6*1424dfb3Schristos 
7*1424dfb3Schristos    This program is free software; you can redistribute it and/or modify
8*1424dfb3Schristos    it under the terms of the GNU General Public License as published by
9*1424dfb3Schristos    the Free Software Foundation; either version 3 of the License, or
10*1424dfb3Schristos    (at your option) any later version.
11*1424dfb3Schristos 
12*1424dfb3Schristos    This program is distributed in the hope that it will be useful,
13*1424dfb3Schristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
14*1424dfb3Schristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*1424dfb3Schristos    GNU General Public License for more details.
16*1424dfb3Schristos 
17*1424dfb3Schristos    You should have received a copy of the GNU General Public License
18*1424dfb3Schristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19*1424dfb3Schristos 
20*1424dfb3Schristos #ifndef COMMON_GDB_SIGNALS_H
21*1424dfb3Schristos #define COMMON_GDB_SIGNALS_H
22*1424dfb3Schristos 
23*1424dfb3Schristos #include "gdb/signals.h"
24*1424dfb3Schristos 
25*1424dfb3Schristos /* Predicate to gdb_signal_to_host(). Return non-zero if the enum
26*1424dfb3Schristos    targ_signal SIGNO has an equivalent ``host'' representation.  */
27*1424dfb3Schristos /* FIXME: cagney/1999-11-22: The name below was chosen in preference
28*1424dfb3Schristos    to the shorter gdb_signal_p() because it is far less ambigious.
29*1424dfb3Schristos    In this context ``gdb_signal'' refers to GDB's internal
30*1424dfb3Schristos    representation of the target's set of signals while ``host signal''
31*1424dfb3Schristos    refers to the target operating system's signal.  Confused?  */
32*1424dfb3Schristos extern int gdb_signal_to_host_p (enum gdb_signal signo);
33*1424dfb3Schristos 
34*1424dfb3Schristos /* Convert between host signal numbers and enum gdb_signal's.
35*1424dfb3Schristos    gdb_signal_to_host() returns 0 and prints a warning() on GDB's
36*1424dfb3Schristos    console if SIGNO has no equivalent host representation.  */
37*1424dfb3Schristos /* FIXME: cagney/1999-11-22: Here ``host'' is used incorrectly, it is
38*1424dfb3Schristos    refering to the target operating system's signal numbering.
39*1424dfb3Schristos    Similarly, ``enum gdb_signal'' is named incorrectly, ``enum
40*1424dfb3Schristos    gdb_signal'' would probably be better as it is refering to GDB's
41*1424dfb3Schristos    internal representation of a target operating system's signal.  */
42*1424dfb3Schristos extern enum gdb_signal gdb_signal_from_host (int);
43*1424dfb3Schristos extern int gdb_signal_to_host (enum gdb_signal);
44*1424dfb3Schristos 
45*1424dfb3Schristos /* Return the enum symbol name of SIG as a string, to use in debug
46*1424dfb3Schristos    output.  */
47*1424dfb3Schristos extern const char *gdb_signal_to_symbol_string (enum gdb_signal sig);
48*1424dfb3Schristos 
49*1424dfb3Schristos /* Return the string for a signal.  */
50*1424dfb3Schristos extern const char *gdb_signal_to_string (enum gdb_signal);
51*1424dfb3Schristos 
52*1424dfb3Schristos /* Return the name (SIGHUP, etc.) for a signal.  */
53*1424dfb3Schristos extern const char *gdb_signal_to_name (enum gdb_signal);
54*1424dfb3Schristos 
55*1424dfb3Schristos /* Given a name (SIGHUP, etc.), return its signal.  */
56*1424dfb3Schristos enum gdb_signal gdb_signal_from_name (const char *);
57*1424dfb3Schristos 
58*1424dfb3Schristos #endif /* COMMON_GDB_SIGNALS_H */
59