Work around MinGW mangling of "host:/path"
[msysgit/historical-msysgit.git] / mingw / info / stabs / Parameters.html
blob312ddf821a18f9d95ff3cfe2177ecdaff33200da
1 <html lang="en">
2 <head>
3 <title>STABS</title>
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">
8 </head>
9 <body>
10 <div class="node">
11 <p>
12 Node:<a name="Parameters">Parameters</a>,
13 Previous:<a rel="previous" accesskey="p" href="Based-Variables.html#Based%20Variables">Based Variables</a>,
14 Up:<a rel="up" accesskey="u" href="Variables.html#Variables">Variables</a>
15 <hr><br>
16 </div>
18 <h3 class="section">Parameters</h3>
20 <p>Formal parameters to a function are represented by a stab (or sometimes
21 two; see below) for each parameter. The stabs are in the order in which
22 the debugger should print the parameters (i.e., the order in which the
23 parameters are declared in the source file). The exact form of the stab
24 depends on how the parameter is being passed.
26 <p>Parameters passed on the stack use the symbol descriptor <code>p</code> and
27 the <code>N_PSYM</code> symbol type (or <code>C_PSYM</code> for XCOFF). The value
28 of the symbol is an offset used to locate the parameter on the stack;
29 its exact meaning is machine-dependent, but on most machines it is an
30 offset from the frame pointer.
32 <p>As a simple example, the code:
34 <pre class="example"> main (argc, argv)
35 int argc;
36 char **argv;
37 </pre>
39 <p>produces the stabs:
41 <pre class="example"> .stabs "main:F1",36,0,0,_main # 36 is N_FUN
42 .stabs "argc:p1",160,0,0,68 # 160 is N_PSYM
43 .stabs "argv:p20=*21=*2",160,0,0,72
44 </pre>
46 <p>The type definition of <code>argv</code> is interesting because it contains
47 several type definitions. Type 21 is pointer to type 2 (char) and
48 <code>argv</code> (type 20) is pointer to type 21.
50 <p>The following symbol descriptors are also said to go with <code>N_PSYM</code>.
51 The value of the symbol is said to be an offset from the argument
52 pointer (I'm not sure whether this is true or not).
54 <pre class="example"> pP (&lt;&lt;??&gt;&gt;)
55 pF Fortran function parameter
56 X (function result variable)
57 </pre>
59 <ul class="menu">
60 <li><a accesskey="1" href="Register-Parameters.html#Register%20Parameters">Register Parameters</a>:
61 <li><a accesskey="2" href="Local-Variable-Parameters.html#Local%20Variable%20Parameters">Local Variable Parameters</a>:
62 <li><a accesskey="3" href="Reference-Parameters.html#Reference%20Parameters">Reference Parameters</a>:
63 <li><a accesskey="4" href="Conformant-Arrays.html#Conformant%20Arrays">Conformant Arrays</a>:
64 </ul>
66 </body></html>