Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / info / stabs / Builtin-Type-Descriptors.html
blob2c2dd0e39029a0f309c59764eed70d787143cfd0
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="Builtin%20Type%20Descriptors">Builtin Type Descriptors</a>,
13 Next:<a rel="next" accesskey="n" href="Negative-Type-Numbers.html#Negative%20Type%20Numbers">Negative Type Numbers</a>,
14 Previous:<a rel="previous" accesskey="p" href="Traditional-Builtin-Types.html#Traditional%20Builtin%20Types">Traditional Builtin Types</a>,
15 Up:<a rel="up" accesskey="u" href="Builtin-Types.html#Builtin%20Types">Builtin Types</a>
16 <hr><br>
17 </div>
19 <h4 class="subsection">Defining Builtin Types Using Builtin Type Descriptors</h4>
21 <p>This is the method used by Sun's <code>acc</code> for defining builtin types.
22 These are the type descriptors to define builtin types:
24 <dl>
25 <dt><code>b </code><var>signed</var><code> </code><var>char-flag</var><code> </code><var>width</var><code> ; </code><var>offset</var><code> ; </code><var>nbits</var><code> ;</code>
26 <dd>Define an integral type. <var>signed</var> is <code>u</code> for unsigned or
27 <code>s</code> for signed. <var>char-flag</var> is <code>c</code> which indicates this
28 is a character type, or is omitted. I assume this is to distinguish an
29 integral type from a character type of the same size, for example it
30 might make sense to set it for the C type <code>wchar_t</code> so the debugger
31 can print such variables differently (Solaris does not do this). Sun
32 sets it on the C types <code>signed char</code> and <code>unsigned char</code> which
33 arguably is wrong. <var>width</var> and <var>offset</var> appear to be for small
34 objects stored in larger ones, for example a <code>short</code> in an
35 <code>int</code> register. <var>width</var> is normally the number of bytes in the
36 type. <var>offset</var> seems to always be zero. <var>nbits</var> is the number
37 of bits in the type.
39 <p>Note that type descriptor <code>b</code> used for builtin types conflicts with
40 its use for Pascal space types (see <a href="Miscellaneous-Types.html#Miscellaneous%20Types">Miscellaneous Types</a>); they can
41 be distinguished because the character following the type descriptor
42 will be a digit, <code>(</code>, or <code>-</code> for a Pascal space type, or
43 <code>u</code> or <code>s</code> for a builtin type.
45 <br><dt><code>w</code>
46 <dd>Documented by AIX to define a wide character type, but their compiler
47 actually uses negative type numbers (see <a href="Negative-Type-Numbers.html#Negative%20Type%20Numbers">Negative Type Numbers</a>).
49 <br><dt><code>R </code><var>fp-type</var><code> ; </code><var>bytes</var><code> ;</code>
50 <dd>Define a floating point type. <var>fp-type</var> has one of the following values:
52 <dl>
53 <dt><code>1 (NF_SINGLE)</code>
54 <dd>IEEE 32-bit (single precision) floating point format.
56 <br><dt><code>2 (NF_DOUBLE)</code>
57 <dd>IEEE 64-bit (double precision) floating point format.
59 <br><dt><code>3 (NF_COMPLEX)</code>
60 <dd><br><dt><code>4 (NF_COMPLEX16)</code>
61 <dd><br><dt><code>5 (NF_COMPLEX32)</code>
62 <dd>These are for complex numbers. A comment in the GDB source describes
63 them as Fortran <code>complex</code>, <code>double complex</code>, and
64 <code>complex*16</code>, respectively, but what does that mean? (i.e., Single
65 precision? Double precision?).
67 <br><dt><code>6 (NF_LDOUBLE)</code>
68 <dd>Long double. This should probably only be used for Sun format
69 <code>long double</code>, and new codes should be used for other floating
70 point formats (<code>NF_DOUBLE</code> can be used if a <code>long double</code> is
71 really just an IEEE double, of course).
72 </dl>
74 <p><var>bytes</var> is the number of bytes occupied by the type. This allows a
75 debugger to perform some operations with the type even if it doesn't
76 understand <var>fp-type</var>.
78 <br><dt><code>g </code><var>type-information</var><code> ; </code><var>nbits</var><code></code>
79 <dd>Documented by AIX to define a floating type, but their compiler actually
80 uses negative type numbers (see <a href="Negative-Type-Numbers.html#Negative%20Type%20Numbers">Negative Type Numbers</a>).
82 <br><dt><code>c </code><var>type-information</var><code> ; </code><var>nbits</var><code></code>
83 <dd>Documented by AIX to define a complex type, but their compiler actually
84 uses negative type numbers (see <a href="Negative-Type-Numbers.html#Negative%20Type%20Numbers">Negative Type Numbers</a>).
85 </dl>
87 <p>The C <code>void</code> type is defined as a signed integral type 0 bits long:
88 <pre class="example"> .stabs "void:t19=bs0;0;0",128,0,0,0
89 </pre>
90 The Solaris compiler seems to omit the trailing semicolon in this case.
91 Getting sloppy in this way is not a swift move because if a type is
92 embedded in a more complex expression it is necessary to be able to tell
93 where it ends.
95 <p>I'm not sure how a boolean type is represented.
97 </body></html>