1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<!-- Copyright (C) 1992-2021 Free Software Foundation, Inc.
4Contributed by Cygnus Support.  Written by Julia Menapace, Jim Kingdon,
5and David MacKenzie.
6
7Permission is granted to copy, distribute and/or modify this document
8under the terms of the GNU Free Documentation License, Version 1.3 or
9any later version published by the Free Software Foundation; with no
10Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
11Texts.  A copy of the license is included in the section entitled "GNU
12Free Documentation License". -->
13<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
14<head>
15<title>STABS: Constants</title>
16
17<meta name="description" content="STABS: Constants">
18<meta name="keywords" content="STABS: Constants">
19<meta name="resource-type" content="document">
20<meta name="distribution" content="global">
21<meta name="Generator" content="makeinfo">
22<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
23<link href="index.html#Top" rel="start" title="Top">
24<link href="Symbol-Types-Index.html#Symbol-Types-Index" rel="index" title="Symbol Types Index">
25<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
26<link href="index.html#Top" rel="up" title="Top">
27<link href="Variables.html#Variables" rel="next" title="Variables">
28<link href="Alternate-Entry-Points.html#Alternate-Entry-Points" rel="previous" title="Alternate Entry Points">
29<style type="text/css">
30<!--
31a.summary-letter {text-decoration: none}
32blockquote.smallquotation {font-size: smaller}
33div.display {margin-left: 3.2em}
34div.example {margin-left: 3.2em}
35div.indentedblock {margin-left: 3.2em}
36div.lisp {margin-left: 3.2em}
37div.smalldisplay {margin-left: 3.2em}
38div.smallexample {margin-left: 3.2em}
39div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
40div.smalllisp {margin-left: 3.2em}
41kbd {font-style:oblique}
42pre.display {font-family: inherit}
43pre.format {font-family: inherit}
44pre.menu-comment {font-family: serif}
45pre.menu-preformatted {font-family: serif}
46pre.smalldisplay {font-family: inherit; font-size: smaller}
47pre.smallexample {font-size: smaller}
48pre.smallformat {font-family: inherit; font-size: smaller}
49pre.smalllisp {font-size: smaller}
50span.nocodebreak {white-space:nowrap}
51span.nolinebreak {white-space:nowrap}
52span.roman {font-family:serif; font-weight:normal}
53span.sansserif {font-family:sans-serif; font-weight:normal}
54ul.no-bullet {list-style: none}
55-->
56</style>
57
58
59</head>
60
61<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
62<a name="Constants"></a>
63<div class="header">
64<p>
65Next: <a href="Variables.html#Variables" accesskey="n" rel="next">Variables</a>, Previous: <a href="Program-Structure.html#Program-Structure" accesskey="p" rel="previous">Program Structure</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Types-Index.html#Symbol-Types-Index" title="Index" rel="index">Index</a>]</p>
66</div>
67<hr>
68<a name="Constants-1"></a>
69<h2 class="chapter">3 Constants</h2>
70
71<p>The &lsquo;<samp>c</samp>&rsquo; symbol descriptor indicates that this stab represents a
72constant.  This symbol descriptor is an exception to the general rule
73that symbol descriptors are followed by type information.  Instead, it
74is followed by &lsquo;<samp>=</samp>&rsquo; and one of the following:
75</p>
76<dl compact="compact">
77<dt><code>b <var>value</var></code></dt>
78<dd><p>Boolean constant.  <var>value</var> is a numeric value; I assume it is 0 for
79false or 1 for true.
80</p>
81</dd>
82<dt><code>c <var>value</var></code></dt>
83<dd><p>Character constant.  <var>value</var> is the numeric value of the constant.
84</p>
85</dd>
86<dt><code>e <var>type-information</var> , <var>value</var></code></dt>
87<dd><p>Constant whose value can be represented as integral.
88<var>type-information</var> is the type of the constant, as it would appear
89after a symbol descriptor (see <a href="String-Field.html#String-Field">String Field</a>).  <var>value</var> is the
90numeric value of the constant.  GDB 4.9 does not actually get the right
91value if <var>value</var> does not fit in a host <code>int</code>, but it does not
92do anything violent, and future debuggers could be extended to accept
93integers of any size (whether unsigned or not).  This constant type is
94usually documented as being only for enumeration constants, but GDB has
95never imposed that restriction; I don&rsquo;t know about other debuggers.
96</p>
97</dd>
98<dt><code>i <var>value</var></code></dt>
99<dd><p>Integer constant.  <var>value</var> is the numeric value.  The type is some
100sort of generic integer type (for GDB, a host <code>int</code>); to specify
101the type explicitly, use &lsquo;<samp>e</samp>&rsquo; instead.
102</p>
103</dd>
104<dt><code>r <var>value</var></code></dt>
105<dd><p>Real constant.  <var>value</var> is the real value, which can be &lsquo;<samp>INF</samp>&rsquo;
106(optionally preceded by a sign) for infinity, &lsquo;<samp>QNAN</samp>&rsquo; for a quiet
107NaN (not-a-number), or &lsquo;<samp>SNAN</samp>&rsquo; for a signalling NaN.  If it is a
108normal number the format is that accepted by the C library function
109<code>atof</code>.
110</p>
111</dd>
112<dt><code>s <var>string</var></code></dt>
113<dd><p>String constant.  <var>string</var> is a string enclosed in either &lsquo;<samp>'</samp>&rsquo;
114(in which case &lsquo;<samp>'</samp>&rsquo; characters within the string are represented as
115&lsquo;<samp>\'</samp>&rsquo; or &lsquo;<samp>&quot;</samp>&rsquo; (in which case &lsquo;<samp>&quot;</samp>&rsquo; characters within the
116string are represented as &lsquo;<samp>\&quot;</samp>&rsquo;).
117</p>
118</dd>
119<dt><code>S <var>type-information</var> , <var>elements</var> , <var>bits</var> , <var>pattern</var></code></dt>
120<dd><p>Set constant.  <var>type-information</var> is the type of the constant, as it
121would appear after a symbol descriptor (see <a href="String-Field.html#String-Field">String Field</a>).
122<var>elements</var> is the number of elements in the set (does this means
123how many bits of <var>pattern</var> are actually used, which would be
124redundant with the type, or perhaps the number of bits set in
125<var>pattern</var>?  I don&rsquo;t get it), <var>bits</var> is the number of bits in the
126constant (meaning it specifies the length of <var>pattern</var>, I think),
127and <var>pattern</var> is a hexadecimal representation of the set.  AIX
128documentation refers to a limit of 32 bytes, but I see no reason why
129this limit should exist.  This form could probably be used for arbitrary
130constants, not just sets; the only catch is that <var>pattern</var> should be
131understood to be target, not host, byte order and format.
132</p></dd>
133</dl>
134
135<p>The boolean, character, string, and set constants are not supported by
136GDB 4.9, but it ignores them.  GDB 4.8 and earlier gave an error
137message and refused to read symbols from the file containing the
138constants.
139</p>
140<p>The above information is followed by &lsquo;<samp>;</samp>&rsquo;.
141</p>
142<hr>
143<div class="header">
144<p>
145Next: <a href="Variables.html#Variables" accesskey="n" rel="next">Variables</a>, Previous: <a href="Program-Structure.html#Program-Structure" accesskey="p" rel="previous">Program Structure</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Symbol-Types-Index.html#Symbol-Types-Index" title="Index" rel="index">Index</a>]</p>
146</div>
147
148
149
150</body>
151</html>
152