[gdbserver] Fix s390x -m31 gdbserver build
[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
a59add0c 12int
075559bc
AC
13main ()
14{
075559bc
AC
15 foo (); /* Put a breakpoint on foo() and call it to see a dummy frame */
16
17
18 have_a_very_merry_interrupt ();
a59add0c 19 return 0;
075559bc
AC
20}
21
22void
23foo (void)
24{
075559bc
AC
25}
26
27void
28bar (void)
29{
d93f7b5c
YQ
30 *(char *)0 = 0; /* try to cause a segfault */
31
32 /* On MMU-less system, previous memory access to address zero doesn't
33 trigger a SIGSEGV. Trigger a SIGILL. Each arch should define its
34 own illegal instruction here. */
35#if defined(__arm__)
36 asm(".word 0xf8f00000");
37#elif defined(__TMS320C6X__)
38 asm(".word 0x56454313");
39#else
40#endif
075559bc 41
075559bc
AC
42}
43
44void
45handler (int sig)
46{
47 subroutine (sig);
48}
49
c56716b0
JM
50/* The first statement in subroutine () is a place for a breakpoint.
51 Without it, the breakpoint is put on the while comparison and will
52 be hit at each iteration. */
53
075559bc
AC
54void
55subroutine (int in)
56{
5d0331e5
JM
57 int count = in;
58 while (count < 100)
59 count++;
075559bc
AC
60}
61
62void
63have_a_very_merry_interrupt (void)
64{
075559bc
AC
65 signal (SIGALRM, handler);
66 alarm (1);
67 sleep (2); /* We'll receive that signal while sleeping */
68}
69
This page took 1.877673 seconds and 4 git commands to generate.