PR gdb/15827
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / signals.c
CommitLineData
c906108c
SS
1/* Test GDB dealing with stuff like stepping into sigtramp. */
2
3#include <signal.h>
085dd6e6 4#include <unistd.h>
c906108c 5
c906108c
SS
6
7static int count = 0;
8
085dd6e6
JM
9#ifdef PROTOTYPES
10static void
11handler (int sig)
12#else
c906108c
SS
13static void
14handler (sig)
15 int sig;
085dd6e6 16#endif
c906108c
SS
17{
18 signal (sig, handler);
19 ++count;
20}
21
22static void
23func1 ()
24{
25 ++count;
26}
27
28static void
29func2 ()
30{
31 ++count;
32}
33
34int
35main ()
36{
c906108c
SS
37#ifdef SIGALRM
38 signal (SIGALRM, handler);
39#endif
40#ifdef SIGUSR1
41 signal (SIGUSR1, handler);
42#endif
43 alarm (1);
44 ++count; /* first */
45 alarm (1);
46 ++count; /* second */
47 func1 ();
48 alarm (1);
49 func2 ();
50 return count;
51}
This page took 1.397804 seconds and 4 git commands to generate.