xref: /netbsd-src/external/gpl3/gdb.old/dist/gdb/testsuite/gdb.base/advance.c (revision 82650ea59673ac1511a0f5b008a97de18ced4707)
1 
2 static int x;
3 
foo(int a)4 int foo (int a)
5 {
6   int b = a + 10;
7   return b;
8 }
9 
bar(int y)10 int bar (int y)
11 {
12   int z = y + 20;
13   return z;
14 }
15 
func2()16 int func2 ()
17 {
18   x = 6;
19   return x;
20 }
21 
func(int c)22 void func(int c)
23 {
24   x = x + 5;
25   func2 ();
26 }
27 
func3()28 int func3 ()
29 {
30   x = 4;
31   return x;
32 }
33 
marker1()34 void marker1 ()
35 {
36 }
37 
38 int
main()39 main ()
40 {
41   int result;
42   int b, c;
43   c = 5;
44   b = 3;    /* advance this location */
45 
46   func (c); /* stop here after leaving current frame */
47   marker1 (); /* stop here after leaving current frame */
48   func3 (); /* break here */
49   result = bar (b + foo (c));
50   return 0; /* advance malformed */
51 }
52 
53