4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"STABS">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"Based%20Variables">Based Variables
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"Parameters.html#Parameters">Parameters
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Statics.html#Statics">Statics
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"Variables.html#Variables">Variables
</a>
19 <h3 class=
"section">Fortran Based Variables
</h3>
21 <p>Fortran (at least, the Sun and SGI dialects of FORTRAN-
77) has a feature
22 which allows allocating arrays with
<code>malloc
</code>, but which avoids
23 blurring the line between arrays and pointers the way that C does. In
24 stabs such a variable uses the
<code>b
</code> symbol descriptor.
26 <p>For example, the Fortran declarations
28 <pre class=
"example"> real foo, foo10(
10), foo10_5(
10,
5)
30 pointer (foo10p, foo10)
31 pointer (foo105p, foo10_5)
36 <pre class=
"example"> foo:b6
38 foo10_5:bar3;
1;
5;ar3;
1;
10;
6
41 <p>In this example,
<code>real
</code> is type
6 and type
3 is an integral type
42 which is the type of the subscripts of the array (probably
43 <code>integer
</code>).
45 <p>The
<code>b
</code> symbol descriptor is like
<code>V
</code> in that it denotes a
46 statically allocated symbol whose scope is local to a function; see
47 See
<a href=
"Statics.html#Statics">Statics
</a>. The value of the symbol, instead of being the address
48 of the variable itself, is the address of a pointer to that variable.
49 So in the above example, the value of the
<code>foo
</code> stab is the address
50 of a pointer to a real, the value of the
<code>foo10
</code> stab is the
51 address of a pointer to a
10-element array of reals, and the value of
52 the
<code>foo10_5
</code> stab is the address of a pointer to a
5-element array
53 of
10-element arrays of reals.