gdb_signals.h 2.5 KB

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