Ada-Glitches.html 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: Ada Glitches</title>
  16. <meta name="description" content="Debugging with GDB: Ada Glitches">
  17. <meta name="keywords" content="Debugging with GDB: Ada Glitches">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="Ada.html#Ada" rel="up" title="Ada">
  26. <link href="Unsupported-Languages.html#Unsupported-Languages" rel="next" title="Unsupported Languages">
  27. <link href="Ada-Settings.html#Ada-Settings" rel="previous" title="Ada Settings">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="Ada-Glitches"></a>
  59. <div class="header">
  60. <p>
  61. Previous: <a href="Ada-Settings.html#Ada-Settings" accesskey="p" rel="previous">Ada Settings</a>, Up: <a href="Ada.html#Ada" accesskey="u" rel="up">Ada</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="Known-Peculiarities-of-Ada-Mode"></a>
  65. <h4 class="subsubsection">15.4.10.11 Known Peculiarities of Ada Mode</h4>
  66. <a name="index-Ada_002c-problems"></a>
  67. <p>Besides the omissions listed previously (see <a href="Omissions-from-Ada.html#Omissions-from-Ada">Omissions from Ada</a>),
  68. we know of several problems with and limitations of Ada mode in
  69. <small>GDB</small>,
  70. some of which will be fixed with planned future releases of the debugger
  71. and the GNU Ada compiler.
  72. </p>
  73. <ul>
  74. <li> Static constants that the compiler chooses not to materialize as objects in
  75. storage are invisible to the debugger.
  76. </li><li> Named parameter associations in function argument lists are ignored (the
  77. argument lists are treated as positional).
  78. </li><li> Many useful library packages are currently invisible to the debugger.
  79. </li><li> Fixed-point arithmetic, conversions, input, and output is carried out using
  80. floating-point arithmetic, and may give results that only approximate those on
  81. the host machine.
  82. </li><li> The GNAT compiler never generates the prefix <code>Standard</code> for any of
  83. the standard symbols defined by the Ada language. <small>GDB</small> knows about
  84. this: it will strip the prefix from names when you use it, and will never
  85. look for a name you have so qualified among local symbols, nor match against
  86. symbols in other packages or subprograms. If you have
  87. defined entities anywhere in your program other than parameters and
  88. local variables whose simple names match names in <code>Standard</code>,
  89. GNAT&rsquo;s lack of qualification here can cause confusion. When this happens,
  90. you can usually resolve the confusion
  91. by qualifying the problematic names with package
  92. <code>Standard</code> explicitly.
  93. </li></ul>
  94. <p>Older versions of the compiler sometimes generate erroneous debugging
  95. information, resulting in the debugger incorrectly printing the value
  96. of affected entities. In some cases, the debugger is able to work
  97. around an issue automatically. In other cases, the debugger is able
  98. to work around the issue, but the work-around has to be specifically
  99. enabled.
  100. </p>
  101. <a name="index-set-ada-trust_002dPAD_002dover_002dXVS"></a>
  102. <a name="index-show-ada-trust_002dPAD_002dover_002dXVS"></a>
  103. <dl compact="compact">
  104. <dt><code>set ada trust-PAD-over-XVS on</code></dt>
  105. <dd><p>Configure GDB to strictly follow the GNAT encoding when computing the
  106. value of Ada entities, particularly when <code>PAD</code> and <code>PAD___XVS</code>
  107. types are involved (see <code>ada/exp_dbug.ads</code> in the GCC sources for
  108. a complete description of the encoding used by the GNAT compiler).
  109. This is the default.
  110. </p>
  111. </dd>
  112. <dt><code>set ada trust-PAD-over-XVS off</code></dt>
  113. <dd><p>This is related to the encoding using by the GNAT compiler. If <small>GDB</small>
  114. sometimes prints the wrong value for certain entities, changing <code>ada
  115. trust-PAD-over-XVS</code> to <code>off</code> activates a work-around which may fix
  116. the issue. It is always safe to set <code>ada trust-PAD-over-XVS</code> to
  117. <code>off</code>, but this incurs a slight performance penalty, so it is
  118. recommended to leave this setting to <code>on</code> unless necessary.
  119. </p>
  120. </dd>
  121. </dl>
  122. <a name="index-GNAT-descriptive-types"></a>
  123. <a name="index-GNAT-encoding"></a>
  124. <p>Internally, the debugger also relies on the compiler following a number
  125. of conventions known as the &lsquo;<samp>GNAT Encoding</samp>&rsquo;, all documented in
  126. <samp>gcc/ada/exp_dbug.ads</samp> in the GCC sources. This encoding describes
  127. how the debugging information should be generated for certain types.
  128. In particular, this convention makes use of <em>descriptive types</em>,
  129. which are artificial types generated purely to help the debugger.
  130. </p>
  131. <p>These encodings were defined at a time when the debugging information
  132. format used was not powerful enough to describe some of the more complex
  133. types available in Ada. Since DWARF allows us to express nearly all
  134. Ada features, the long-term goal is to slowly replace these descriptive
  135. types by their pure DWARF equivalent. To facilitate that transition,
  136. a new maintenance option is available to force the debugger to ignore
  137. those descriptive types. It allows the user to quickly evaluate how
  138. well <small>GDB</small> works without them.
  139. </p>
  140. <dl compact="compact">
  141. <dd>
  142. <a name="index-maint-ada-set-ignore_002ddescriptive_002dtypes"></a>
  143. </dd>
  144. <dt><code>maintenance ada set ignore-descriptive-types [on|off]</code></dt>
  145. <dd><p>Control whether the debugger should ignore descriptive types.
  146. The default is not to ignore descriptives types (<code>off</code>).
  147. </p>
  148. <a name="index-maint-ada-show-ignore_002ddescriptive_002dtypes"></a>
  149. </dd>
  150. <dt><code>maintenance ada show ignore-descriptive-types</code></dt>
  151. <dd><p>Show if descriptive types are ignored by <small>GDB</small>.
  152. </p>
  153. </dd>
  154. </dl>
  155. <hr>
  156. <div class="header">
  157. <p>
  158. Previous: <a href="Ada-Settings.html#Ada-Settings" accesskey="p" rel="previous">Ada Settings</a>, Up: <a href="Ada.html#Ada" accesskey="u" rel="up">Ada</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  159. </div>
  160. </body>
  161. </html>