OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-7.1/] [gdb/] [testsuite/] [gdb.reverse/] [step-reverse.c] - Blame information for rev 252

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 227 jeremybenn
/* This testcase is part of GDB, the GNU debugger.
2
 
3
   Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
4
 
5
   This program is free software; you can redistribute it and/or modify
6
   it under the terms of the GNU General Public License as published by
7
   the Free Software Foundation; either version 3 of the License, or
8
   (at your option) any later version.
9
 
10
   This program is distributed in the hope that it will be useful,
11
   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
   GNU General Public License for more details.
14
 
15
   You should have received a copy of the GNU General Public License
16
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
17
 
18
#include <stdlib.h>
19
#include <string.h>
20
 
21
/* Test various kinds of stepping.
22
*/
23
int myglob = 0;
24
 
25
int callee() {          /* ENTER CALLEE */
26
  myglob++; return 0;    /* ARRIVED IN CALLEE */
27
}                       /* RETURN FROM CALLEE */
28
 
29
/* A structure which, we hope, will need to be passed using memcpy.  */
30
struct rhomboidal {
31
  int rather_large[100];
32
};
33
 
34
void
35
large_struct_by_value (struct rhomboidal r)
36
{
37
  myglob += r.rather_large[42]; /* step-test.exp: arrive here 1 */
38
}
39
 
40
int main () {
41
   int w,x,y,z;
42
   int a[10], b[10];
43
 
44
   /* Test "next" and "step" */
45
   w = 0;        /* BREAK AT MAIN */
46
   x = 1;       /* NEXT TEST 1 */
47
   y = 2;       /* STEP TEST 1 */
48
   z = 3;       /* REVERSE NEXT TEST 1 */
49
   w = w + 2;   /* NEXT TEST 2 */
50
   x = x + 3;   /* REVERSE STEP TEST 1 */
51
   y = y + 4;
52
   z = z + 5;   /* STEP TEST 2 */
53
 
54
   /* Test that "next" goes over a call */
55
   callee();    /* NEXT OVER THIS CALL */
56
 
57
   /* Test that "step" doesn't */
58
   callee();    /* STEP INTO THIS CALL */
59
 
60
   /* Test "stepi" */
61
   a[5] = a[3] - a[4]; /* FINISH TEST */
62
   callee();    /* STEPI TEST */
63
 
64
   /* Test "nexti" */
65
   callee();    /* NEXTI TEST */
66
 
67
   y = w + z;
68
 
69
   {
70
     struct rhomboidal r;
71
     memset (r.rather_large, 0, sizeof (r.rather_large));
72
     r.rather_large[42] = 10;
73
     large_struct_by_value (r);  /* step-test.exp: large struct by value */
74
   }
75
 
76
   exit (0); /* end of main */
77
}
78
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.