Sync usage with man page.
[netbsd-mini2440.git] / gnu / dist / gdb6 / gdb / testsuite / gdb.base / step-test.c
bloba1e1dc408cf382b762076e14a187c9ec38c9aa4c
1 #include <stdlib.h>
2 #include <string.h>
4 /* Test various kinds of stepping.
5 */
6 int myglob = 0;
8 int callee() {
9 myglob++; return 0;
12 /* A structure which, we hope, will need to be passed using memcpy. */
13 struct rhomboidal {
14 int rather_large[100];
17 void
18 large_struct_by_value (struct rhomboidal r)
20 myglob += r.rather_large[42]; /* step-test.exp: arrive here 1 */
23 int main () {
24 int w,x,y,z;
25 int a[10], b[10];
27 /* Test "next" and "step" */
28 w = 0;
29 x = 1;
30 y = 2;
31 z = 3;
32 w = w + 2;
33 x = x + 3;
34 y = y + 4;
35 z = z + 5;
37 /* Test that "next" goes over a call */
38 callee(); /* OVER */
40 /* Test that "step" doesn't */
41 callee(); /* INTO */
43 /* Test "stepi" */
44 a[5] = a[3] - a[4];
45 callee(); /* STEPI */
47 /* Test "nexti" */
48 callee(); /* NEXTI */
50 y = w + z;
53 struct rhomboidal r;
54 memset (r.rather_large, 0, sizeof (r.rather_large));
55 r.rather_large[42] = 10;
56 large_struct_by_value (r); /* step-test.exp: large struct by value */
59 exit (0);