Omissions-from-Ada.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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-2019 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.2, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: Omissions from Ada</title>
  16. <meta name="description" content="Debugging with GDB: Omissions from Ada">
  17. <meta name="keywords" content="Debugging with GDB: Omissions from Ada">
  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="Additions-to-Ada.html#Additions-to-Ada" rel="next" title="Additions to Ada">
  27. <link href="Ada-Mode-Intro.html#Ada-Mode-Intro" rel="prev" title="Ada Mode Intro">
  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="Omissions-from-Ada"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="Additions-to-Ada.html#Additions-to-Ada" accesskey="n" rel="next">Additions to Ada</a>, Previous: <a href="Ada-Mode-Intro.html#Ada-Mode-Intro" accesskey="p" rel="prev">Ada Mode Intro</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="Omissions-from-Ada-1"></a>
  65. <h4 class="subsubsection">15.4.10.2 Omissions from Ada</h4>
  66. <a name="index-Ada_002c-omissions-from"></a>
  67. <p>Here are the notable omissions from the subset:
  68. </p>
  69. <ul>
  70. <li> Only a subset of the attributes are supported:
  71. <ul class="no-bullet">
  72. <li>- <tt>'First</tt>, <tt>'Last</tt>, and <tt>'Length</tt>
  73. on array objects (not on types and subtypes).
  74. </li><li>- <tt>'Min</tt> and <tt>'Max</tt>.
  75. </li><li>- <tt>'Pos</tt> and <tt>'Val</tt>.
  76. </li><li>- <tt>'Tag</tt>.
  77. </li><li>- <tt>'Range</tt> on array objects (not subtypes), but only as the right
  78. operand of the membership (<code>in</code>) operator.
  79. </li><li>- <tt>'Access</tt>, <tt>'Unchecked_Access</tt>, and
  80. <tt>'Unrestricted_Access</tt> (a GNAT extension).
  81. </li><li>- <tt>'Address</tt>.
  82. </li></ul>
  83. </li><li> The names in
  84. <code>Characters.Latin_1</code> are not available and
  85. concatenation is not implemented. Thus, escape characters in strings are
  86. not currently available.
  87. </li><li> Equality tests (&lsquo;<samp>=</samp>&rsquo; and &lsquo;<samp>/=</samp>&rsquo;) on arrays test for bitwise
  88. equality of representations. They will generally work correctly
  89. for strings and arrays whose elements have integer or enumeration types.
  90. They may not work correctly for arrays whose element
  91. types have user-defined equality, for arrays of real values
  92. (in particular, IEEE-conformant floating point, because of negative
  93. zeroes and NaNs), and for arrays whose elements contain unused bits with
  94. indeterminate values.
  95. </li><li> The other component-by-component array operations (<code>and</code>, <code>or</code>,
  96. <code>xor</code>, <code>not</code>, and relational tests other than equality)
  97. are not implemented.
  98. </li><li> <a name="index-array-aggregates-_0028Ada_0029"></a>
  99. <a name="index-record-aggregates-_0028Ada_0029"></a>
  100. <a name="index-aggregates-_0028Ada_0029"></a>
  101. There is limited support for array and record aggregates. They are
  102. permitted only on the right sides of assignments, as in these examples:
  103. <div class="smallexample">
  104. <pre class="smallexample">(gdb) set An_Array := (1, 2, 3, 4, 5, 6)
  105. (gdb) set An_Array := (1, others =&gt; 0)
  106. (gdb) set An_Array := (0|4 =&gt; 1, 1..3 =&gt; 2, 5 =&gt; 6)
  107. (gdb) set A_2D_Array := ((1, 2, 3), (4, 5, 6), (7, 8, 9))
  108. (gdb) set A_Record := (1, &quot;Peter&quot;, True);
  109. (gdb) set A_Record := (Name =&gt; &quot;Peter&quot;, Id =&gt; 1, Alive =&gt; True)
  110. </pre></div>
  111. <p>Changing a
  112. discriminant&rsquo;s value by assigning an aggregate has an
  113. undefined effect if that discriminant is used within the record.
  114. However, you can first modify discriminants by directly assigning to
  115. them (which normally would not be allowed in Ada), and then performing an
  116. aggregate assignment. For example, given a variable <code>A_Rec</code>
  117. declared to have a type such as:
  118. </p>
  119. <div class="smallexample">
  120. <pre class="smallexample">type Rec (Len : Small_Integer := 0) is record
  121. Id : Integer;
  122. Vals : IntArray (1 .. Len);
  123. end record;
  124. </pre></div>
  125. <p>you can assign a value with a different size of <code>Vals</code> with two
  126. assignments:
  127. </p>
  128. <div class="smallexample">
  129. <pre class="smallexample">(gdb) set A_Rec.Len := 4
  130. (gdb) set A_Rec := (Id =&gt; 42, Vals =&gt; (1, 2, 3, 4))
  131. </pre></div>
  132. <p>As this example also illustrates, <small>GDB</small> is very loose about the usual
  133. rules concerning aggregates. You may leave out some of the
  134. components of an array or record aggregate (such as the <code>Len</code>
  135. component in the assignment to <code>A_Rec</code> above); they will retain their
  136. original values upon assignment. You may freely use dynamic values as
  137. indices in component associations. You may even use overlapping or
  138. redundant component associations, although which component values are
  139. assigned in such cases is not defined.
  140. </p>
  141. </li><li> Calls to dispatching subprograms are not implemented.
  142. </li><li> The overloading algorithm is much more limited (i.e., less selective)
  143. than that of real Ada. It makes only limited use of the context in
  144. which a subexpression appears to resolve its meaning, and it is much
  145. looser in its rules for allowing type matches. As a result, some
  146. function calls will be ambiguous, and the user will be asked to choose
  147. the proper resolution.
  148. </li><li> The <code>new</code> operator is not implemented.
  149. </li><li> Entry calls are not implemented.
  150. </li><li> Aside from printing, arithmetic operations on the native VAX floating-point
  151. formats are not supported.
  152. </li><li> It is not possible to slice a packed array.
  153. </li><li> The names <code>True</code> and <code>False</code>, when not part of a qualified name,
  154. are interpreted as if implicitly prefixed by <code>Standard</code>, regardless of
  155. context.
  156. Should your program
  157. redefine these names in a package or procedure (at best a dubious practice),
  158. you will have to use fully qualified names to access their new definitions.
  159. </li></ul>
  160. <hr>
  161. <div class="header">
  162. <p>
  163. Next: <a href="Additions-to-Ada.html#Additions-to-Ada" accesskey="n" rel="next">Additions to Ada</a>, Previous: <a href="Ada-Mode-Intro.html#Ada-Mode-Intro" accesskey="p" rel="prev">Ada Mode Intro</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>
  164. </div>
  165. </body>
  166. </html>