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=
"Common%20Blocks">Common Blocks
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"Statics.html#Statics">Statics
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Register-Variables.html#Register%20Variables">Register Variables
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"Variables.html#Variables">Variables
</a>
19 <h3 class=
"section">Common Blocks
</h3>
21 <p>A common block is a statically allocated section of memory which can be
22 referred to by several source files. It may contain several variables.
23 I believe Fortran is the only language with this feature.
25 <p>A
<code>N_BCOMM
</code> stab begins a common block and an
<code>N_ECOMM
</code> stab
26 ends it. The only field that is significant in these two stabs is the
27 string, which names a normal (non-debugging) symbol that gives the
28 address of the common block. According to IBM documentation, only the
29 <code>N_BCOMM
</code> has the name of the common block (even though their
30 compiler actually puts it both places).
32 <p>The stabs for the members of the common block are between the
33 <code>N_BCOMM
</code> and the
<code>N_ECOMM
</code>; the value of each stab is the
34 offset within the common block of that variable. IBM uses the
35 <code>C_ECOML
</code> stab type, and there is a corresponding
<code>N_ECOML
</code>
36 stab type, but Sun's Fortran compiler uses
<code>N_GSYM
</code> instead. The
37 variables within a common block use the
<code>V
</code> symbol descriptor (I
38 believe this is true of all Fortran variables). Other stabs (at least
39 type declarations using
<code>C_DECL
</code>) can also be between the
40 <code>N_BCOMM
</code> and the
<code>N_ECOMM
</code>.