gdb/gdbserver/
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-syn-frame.c
CommitLineData
075559bc
AC
1#include <signal.h>
2#include <unistd.h>
3#include <stdlib.h>
4
5void foo (void);
6void bar (void);
7
8void subroutine (int);
9void handler (int);
10void have_a_very_merry_interrupt (void);
11
12main ()
13{
075559bc
AC
14 foo (); /* Put a breakpoint on foo() and call it to see a dummy frame */
15
16
17 have_a_very_merry_interrupt ();
075559bc
AC
18}
19
20void
21foo (void)
22{
075559bc
AC
23}
24
25void
26bar (void)
27{
28 char *nuller = 0;
29
075559bc
AC
30 *nuller = 'a'; /* try to cause a segfault */
31}
32
33void
34handler (int sig)
35{
36 subroutine (sig);
37}
38
c56716b0
JM
39/* The first statement in subroutine () is a place for a breakpoint.
40 Without it, the breakpoint is put on the while comparison and will
41 be hit at each iteration. */
42
075559bc
AC
43void
44subroutine (int in)
45{
5d0331e5
JM
46 int count = in;
47 while (count < 100)
48 count++;
075559bc
AC
49}
50
51void
52have_a_very_merry_interrupt (void)
53{
075559bc
AC
54 signal (SIGALRM, handler);
55 alarm (1);
56 sleep (2); /* We'll receive that signal while sleeping */
57}
58
This page took 0.882199 seconds and 4 git commands to generate.