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=
"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>
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:
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
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:
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).
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>).
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
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
95 <p>I'm not sure how a boolean type is represented.