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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gdb-7.1/] [gdb/] [doc/] [stack_frame.txt] - Blame information for rev 853

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

Line No. Rev Author Line
1 227 jeremybenn
                  ^    ->|            |
2
Frame             |   |  |            |
3
Number          - |   |  |============|       int fact (int n)
4
               |  |   |  |   i = 3    |       {
5
               |  |   |  |------------|         if (0 == n) {
6
               |  |   |  |   f = ?    |           return  1;  <-------- PC
7
  #4 main()   <   |   |  |------------|        }
8
               |  |   |  |            |         else {
9
               |  |  -+->|------------|   --->    return n * fact (n - 1);
10
               |   -+-+--+-----o      |  |      }
11
                =   | |  |============|  |    }
12
               |    | |  |   n = 3    |  |
13
               |    | |  |------------|  |    main ()
14
  #3 fact (3) <     | |  |     o---------+-   {
15
               |   -+-+->|------------|  | |    int  i;
16
               |  | |  --+-----o      |  | |
17
                = | |    |============|  | |    for (i = 0; i < 10; i++) {
18
               |  | |    |   n = 2    |  |  ->    int  f = fact (i);
19
               |  | |    |------------|  |        printf ("%d! = %d\n", i , f);
20
  #2 fact (2) <   | |    |     o------+--|      }
21
               |  | |  ->|------------|  |    }
22
               |  |  -+--+-----o      |  |
23
                = |   |  |============|  |
24
               |  |   |  |   n = 1    |  |
25
               |  |   |  |------------|  |
26
  #1 fact (1) <   |   |  |     o------+--|
27
               |  |   |  |------------|  |
28
               |   ---|--+-----o      |<-+------- FP
29
                =     |  |============|  |                   |
30
               |      |  |   n = 0    |  |                   |
31
               |      |  |------------|  |                   |
32
  #0 fact (0) <       |  |     o---------                    |
33
               |      |  |------------|                      |
34
               |       --+-----o      |<--------- SP         |
35
                =        |============|                      |
36
               |         |  Red Zone  |                      v
37
               |         \/\/\/\/\/\/\/                 Direction of
38
  #-1         <          \/\/\/\/\/\/\/                 stack growth
39
               |         |            |

powered by: WebSVN 2.1.0

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