Constants.html 7.4 KB

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