Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gdb6 / gdb / testsuite / gdb.mi / mi-syn-frame.c
blob580b5342716f13d7ba4a22b96ada319e922aecb7
1 #include <signal.h>
2 #include <unistd.h>
3 #include <stdlib.h>
5 void foo (void);
6 void bar (void);
8 void subroutine (int);
9 void handler (int);
10 void have_a_very_merry_interrupt (void);
12 main ()
14 puts ("Starting up");
16 foo (); /* Put a breakpoint on foo() and call it to see a dummy frame */
19 have_a_very_merry_interrupt ();
21 puts ("Shutting down");
24 void
25 foo (void)
27 puts ("hi in foo");
30 void
31 bar (void)
33 char *nuller = 0;
35 puts ("hi in bar");
37 *nuller = 'a'; /* try to cause a segfault */
40 void
41 handler (int sig)
43 subroutine (sig);
46 /* The first statement in subroutine () is a place for a breakpoint.
47 Without it, the breakpoint is put on the while comparison and will
48 be hit at each iteration. */
50 void
51 subroutine (int in)
53 int count = in;
54 while (count < 100)
55 count++;
58 void
59 have_a_very_merry_interrupt (void)
61 puts ("Waiting to get a signal");
62 signal (SIGALRM, handler);
63 alarm (1);
64 sleep (2); /* We'll receive that signal while sleeping */