repo.or.cz
/
binutils-gdb.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix: Null pointer dereference in ldlex.l
[binutils-gdb.git]
/
gdb
/
testsuite
/
gdb.base
/
signals.c
blob
756606880fa5157e1165d90c25658b72ce9d2f20
1
/* Test GDB dealing with stuff like stepping into sigtramp. */
2
3
#include <signal.h>
4
#include <unistd.h>
5
6
7
static int
count
=
0
;
8
9
static void
10
handler
(
int
sig
)
11
{
12
signal
(
sig
,
handler
);
13
++
count
;
14
}
15
16
static void
17
func1
()
18
{
19
++
count
;
20
}
21
22
static void
23
func2
()
24
{
25
++
count
;
26
}
27
28
int
29
main
()
30
{
31
#ifdef SIGALRM
32
signal
(
SIGALRM
,
handler
);
33
#endif
34
#ifdef SIGUSR1
35
signal
(
SIGUSR1
,
handler
);
36
#endif
37
alarm
(
1
);
38
++
count
;
/* first */
39
alarm
(
1
);
40
++
count
;
/* second */
41
func1
();
42
alarm
(
1
);
43
func2
();
44
return
count
;
45
}