Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

Additions-to-Ada.html 8.5KB

3 anos atrás
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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>Additions to Ada (Debugging with GDB)</title>
  17. <meta name="description" content="Additions to Ada (Debugging with GDB)">
  18. <meta name="keywords" content="Additions to Ada (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="Overloading-support-for-Ada.html#Overloading-support-for-Ada" rel="next" title="Overloading support for Ada">
  27. <link href="Omissions-from-Ada.html#Omissions-from-Ada" rel="prev" title="Omissions from Ada">
  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="Additions-to-Ada"></a>
  58. <div class="header">
  59. <p>
  60. Next: <a href="Overloading-support-for-Ada.html#Overloading-support-for-Ada" accesskey="n" rel="next">Overloading support for Ada</a>, Previous: <a href="Omissions-from-Ada.html#Omissions-from-Ada" accesskey="p" rel="prev">Omissions from Ada</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="Additions-to-Ada-1"></a>
  64. <h4 class="subsubsection">15.4.10.3 Additions to Ada</h4>
  65. <a name="index-Ada_002c-deviations-from"></a>
  66. <p>As it does for other languages, <small>GDB</small> makes certain generic
  67. extensions to Ada (see <a href="Expressions.html#Expressions">Expressions</a>):
  68. </p>
  69. <ul>
  70. <li> If the expression <var>E</var> is a variable residing in memory (typically
  71. a local variable or array element) and <var>N</var> is a positive integer,
  72. then <code><var>E</var>@<var>N</var></code> displays the values of <var>E</var> and the
  73. <var>N</var>-1 adjacent variables following it in memory as an array. In
  74. Ada, this operator is generally not necessary, since its prime use is
  75. in displaying parts of an array, and slicing will usually do this in
  76. Ada. However, there are occasional uses when debugging programs in
  77. which certain debugging information has been optimized away.
  78. </li><li> <code><var>B</var>::<var>var</var></code> means &ldquo;the variable named <var>var</var> that
  79. appears in function or file <var>B</var>.&rdquo; When <var>B</var> is a file name,
  80. you must typically surround it in single quotes.
  81. </li><li> The expression <code>{<var>type</var>} <var>addr</var></code> means &ldquo;the variable of type
  82. <var>type</var> that appears at address <var>addr</var>.&rdquo;
  83. </li><li> A name starting with &lsquo;<samp>$</samp>&rsquo; is a convenience variable
  84. (see <a href="Convenience-Vars.html#Convenience-Vars">Convenience Vars</a>) or a machine register (see <a href="Registers.html#Registers">Registers</a>).
  85. </li></ul>
  86. <p>In addition, <small>GDB</small> provides a few other shortcuts and outright
  87. additions specific to Ada:
  88. </p>
  89. <ul>
  90. <li> The assignment statement is allowed as an expression, returning
  91. its right-hand operand as its value. Thus, you may enter
  92. <div class="smallexample">
  93. <pre class="smallexample">(gdb) set x := y + 3
  94. (gdb) print A(tmp := y + 1)
  95. </pre></div>
  96. </li><li> The semicolon is allowed as an &ldquo;operator,&rdquo; returning as its value
  97. the value of its right-hand operand.
  98. This allows, for example,
  99. complex conditional breaks:
  100. <div class="smallexample">
  101. <pre class="smallexample">(gdb) break f
  102. (gdb) condition 1 (report(i); k += 1; A(k) &gt; 100)
  103. </pre></div>
  104. </li><li> Rather than use catenation and symbolic character names to introduce special
  105. characters into strings, one may instead use a special bracket notation,
  106. which is also used to print strings. A sequence of characters of the form
  107. &lsquo;<samp>[&quot;<var>XX</var>&quot;]</samp>&rsquo; within a string or character literal denotes the
  108. (single) character whose numeric encoding is <var>XX</var> in hexadecimal. The
  109. sequence of characters &lsquo;<samp>[&quot;&quot;&quot;]</samp>&rsquo; also denotes a single quotation mark
  110. in strings. For example,
  111. <div class="smallexample">
  112. <pre class="smallexample"> &quot;One line.[&quot;0a&quot;]Next line.[&quot;0a&quot;]&quot;
  113. </pre></div>
  114. <p>contains an ASCII newline character (<code>Ada.Characters.Latin_1.LF</code>)
  115. after each period.
  116. </p>
  117. </li><li> The subtype used as a prefix for the attributes <tt>'Pos</tt>, <tt>'Min</tt>, and
  118. <tt>'Max</tt> is optional (and is ignored in any case). For example, it is valid
  119. to write
  120. <div class="smallexample">
  121. <pre class="smallexample">(gdb) print 'max(x, y)
  122. </pre></div>
  123. </li><li> When printing arrays, <small>GDB</small> uses positional notation when the
  124. array has a lower bound of 1, and uses a modified named notation otherwise.
  125. For example, a one-dimensional array of three integers with a lower bound
  126. of 3 might print as
  127. <div class="smallexample">
  128. <pre class="smallexample">(3 =&gt; 10, 17, 1)
  129. </pre></div>
  130. <p>That is, in contrast to valid Ada, only the first component has a <code>=&gt;</code>
  131. clause.
  132. </p>
  133. </li><li> You may abbreviate attributes in expressions with any unique,
  134. multi-character subsequence of
  135. their names (an exact match gets preference).
  136. For example, you may use <tt>a'len</tt>, <tt>a'gth</tt>, or <tt>a'lh</tt>
  137. in place of <tt>a'length</tt>.
  138. </li><li> <a name="index-quoting-Ada-internal-identifiers"></a>
  139. Since Ada is case-insensitive, the debugger normally maps identifiers you type
  140. to lower case. The GNAT compiler uses upper-case characters for
  141. some of its internal identifiers, which are normally of no interest to users.
  142. For the rare occasions when you actually have to look at them,
  143. enclose them in angle brackets to avoid the lower-case mapping.
  144. For example,
  145. <div class="smallexample">
  146. <pre class="smallexample">(gdb) print &lt;JMPBUF_SAVE&gt;[0]
  147. </pre></div>
  148. </li><li> Printing an object of class-wide type or dereferencing an
  149. access-to-class-wide value will display all the components of the object&rsquo;s
  150. specific type (as indicated by its run-time tag). Likewise, component
  151. selection on such a value will operate on the specific type of the
  152. object.
  153. </li></ul>
  154. <hr>
  155. <div class="header">
  156. <p>
  157. Next: <a href="Overloading-support-for-Ada.html#Overloading-support-for-Ada" accesskey="n" rel="next">Overloading support for Ada</a>, Previous: <a href="Omissions-from-Ada.html#Omissions-from-Ada" accesskey="p" rel="prev">Omissions from Ada</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>