signals.h
Go to the documentation of this file.
1 /* Target signal numbers for GDB and the GDB remote protocol.
2  Copyright (C) 1986-2019 Free Software Foundation, Inc.
3 
4  This file is part of GDB.
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 
19 #ifndef GDB_SIGNALS_H
20 #define GDB_SIGNALS_H
21 
22 /* The numbering of these signals is chosen to match traditional unix
23  signals (insofar as various unices use the same numbers, anyway).
24  It is also the numbering of the GDB remote protocol. Other remote
25  protocols, if they use a different numbering, should make sure to
26  translate appropriately.
27 
28  Since these numbers have actually made it out into other software
29  (stubs, etc.), you mustn't disturb the assigned numbering. If you
30  need to add new signals here, add them to the end of the explicitly
31  numbered signals, at the comment marker. Add them unconditionally,
32  not within any #if or #ifdef.
33 
34  This is based strongly on Unix/POSIX signals for several reasons:
35  (1) This set of signals represents a widely-accepted attempt to
36  represent events of this sort in a portable fashion, (2) we want a
37  signal to make it from wait to child_wait to the user intact, (3) many
38  remote protocols use a similar encoding. However, it is
39  recognized that this set of signals has limitations (such as not
40  distinguishing between various kinds of SIGSEGV, or not
41  distinguishing hitting a breakpoint from finishing a single step).
42  So in the future we may get around this either by adding additional
43  signals for breakpoint, single-step, etc., or by adding signal
44  codes; the latter seems more in the spirit of what BSD, System V,
45  etc. are doing to address these issues. */
46 
47 /* For an explanation of what each signal means, see
48  gdb_signal_to_string. */
49 
51  {
52 #define SET(symbol, constant, name, string) \
53  symbol = constant,
54 #include "signals.def"
55 #undef SET
56  };
57 
58 #endif /* #ifndef GDB_SIGNALS_H */
gdb_signal
Definition: signals.h:51