You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

178 lines
8.1KB

  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 6.5, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  16. <title>Ada Glitches (Debugging with GDB)</title>
  17. <meta name="description" content="Ada Glitches (Debugging with GDB)">
  18. <meta name="keywords" content="Ada Glitches (Debugging with GDB)">
  19. <meta name="resource-type" content="document">
  20. <meta name="distribution" content="global">
  21. <meta name="Generator" content="makeinfo">
  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="prev" title="Ada Settings">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.indentedblock {margin-right: 0em}
  32. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  33. blockquote.smallquotation {font-size: smaller}
  34. div.display {margin-left: 3.2em}
  35. div.example {margin-left: 3.2em}
  36. div.lisp {margin-left: 3.2em}
  37. div.smalldisplay {margin-left: 3.2em}
  38. div.smallexample {margin-left: 3.2em}
  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.nolinebreak {white-space: nowrap}
  50. span.roman {font-family: initial; 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">
  57. <a name="Ada-Glitches"></a>
  58. <div class="header">
  59. <p>
  60. Previous: <a href="Ada-Settings.html#Ada-Settings" accesskey="p" rel="prev">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>
  61. </div>
  62. <hr>
  63. <a name="Known-Peculiarities-of-Ada-Mode"></a>
  64. <h4 class="subsubsection">15.4.10.11 Known Peculiarities of Ada Mode</h4>
  65. <a name="index-Ada_002c-problems"></a>
  66. <p>Besides the omissions listed previously (see <a href="Omissions-from-Ada.html#Omissions-from-Ada">Omissions from Ada</a>),
  67. we know of several problems with and limitations of Ada mode in
  68. <small>GDB</small>,
  69. some of which will be fixed with planned future releases of the debugger
  70. and the GNU Ada compiler.
  71. </p>
  72. <ul>
  73. <li> Static constants that the compiler chooses not to materialize as objects in
  74. storage are invisible to the debugger.
  75. </li><li> Named parameter associations in function argument lists are ignored (the
  76. argument lists are treated as positional).
  77. </li><li> Many useful library packages are currently invisible to the debugger.
  78. </li><li> Fixed-point arithmetic, conversions, input, and output is carried out using
  79. floating-point arithmetic, and may give results that only approximate those on
  80. the host machine.
  81. </li><li> The GNAT compiler never generates the prefix <code>Standard</code> for any of
  82. the standard symbols defined by the Ada language. <small>GDB</small> knows about
  83. this: it will strip the prefix from names when you use it, and will never
  84. look for a name you have so qualified among local symbols, nor match against
  85. symbols in other packages or subprograms. If you have
  86. defined entities anywhere in your program other than parameters and
  87. local variables whose simple names match names in <code>Standard</code>,
  88. GNAT&rsquo;s lack of qualification here can cause confusion. When this happens,
  89. you can usually resolve the confusion
  90. by qualifying the problematic names with package
  91. <code>Standard</code> explicitly.
  92. </li></ul>
  93. <p>Older versions of the compiler sometimes generate erroneous debugging
  94. information, resulting in the debugger incorrectly printing the value
  95. of affected entities. In some cases, the debugger is able to work
  96. around an issue automatically. In other cases, the debugger is able
  97. to work around the issue, but the work-around has to be specifically
  98. enabled.
  99. </p>
  100. <a name="index-set-ada-trust_002dPAD_002dover_002dXVS"></a>
  101. <a name="index-show-ada-trust_002dPAD_002dover_002dXVS"></a>
  102. <dl compact="compact">
  103. <dt><code>set ada trust-PAD-over-XVS on</code></dt>
  104. <dd><p>Configure GDB to strictly follow the GNAT encoding when computing the
  105. value of Ada entities, particularly when <code>PAD</code> and <code>PAD___XVS</code>
  106. types are involved (see <code>ada/exp_dbug.ads</code> in the GCC sources for
  107. a complete description of the encoding used by the GNAT compiler).
  108. This is the default.
  109. </p>
  110. </dd>
  111. <dt><code>set ada trust-PAD-over-XVS off</code></dt>
  112. <dd><p>This is related to the encoding using by the GNAT compiler. If <small>GDB</small>
  113. sometimes prints the wrong value for certain entities, changing <code>ada
  114. trust-PAD-over-XVS</code> to <code>off</code> activates a work-around which may fix
  115. the issue. It is always safe to set <code>ada trust-PAD-over-XVS</code> to
  116. <code>off</code>, but this incurs a slight performance penalty, so it is
  117. recommended to leave this setting to <code>on</code> unless necessary.
  118. </p>
  119. </dd>
  120. </dl>
  121. <a name="index-GNAT-descriptive-types"></a>
  122. <a name="index-GNAT-encoding"></a>
  123. <p>Internally, the debugger also relies on the compiler following a number
  124. of conventions known as the &lsquo;<samp>GNAT Encoding</samp>&rsquo;, all documented in
  125. <samp>gcc/ada/exp_dbug.ads</samp> in the GCC sources. This encoding describes
  126. how the debugging information should be generated for certain types.
  127. In particular, this convention makes use of <em>descriptive types</em>,
  128. which are artificial types generated purely to help the debugger.
  129. </p>
  130. <p>These encodings were defined at a time when the debugging information
  131. format used was not powerful enough to describe some of the more complex
  132. types available in Ada. Since DWARF allows us to express nearly all
  133. Ada features, the long-term goal is to slowly replace these descriptive
  134. types by their pure DWARF equivalent. To facilitate that transition,
  135. a new maintenance option is available to force the debugger to ignore
  136. those descriptive types. It allows the user to quickly evaluate how
  137. well <small>GDB</small> works without them.
  138. </p>
  139. <dl compact="compact">
  140. <dd>
  141. <a name="index-maint-ada-set-ignore_002ddescriptive_002dtypes"></a>
  142. </dd>
  143. <dt><code>maintenance ada set ignore-descriptive-types [on|off]</code></dt>
  144. <dd><p>Control whether the debugger should ignore descriptive types.
  145. The default is not to ignore descriptives types (<code>off</code>).
  146. </p>
  147. <a name="index-maint-ada-show-ignore_002ddescriptive_002dtypes"></a>
  148. </dd>
  149. <dt><code>maintenance ada show ignore-descriptive-types</code></dt>
  150. <dd><p>Show if descriptive types are ignored by <small>GDB</small>.
  151. </p>
  152. </dd>
  153. </dl>
  154. <hr>
  155. <div class="header">
  156. <p>
  157. Previous: <a href="Ada-Settings.html#Ada-Settings" accesskey="p" rel="prev">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>
  158. </div>
  159. </body>
  160. </html>