<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <!-- Copyright (C) 1988-2019 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being "Free Software" and "Free Software Needs Free Documentation", with the Front-Cover Texts being "A GNU Manual," and with the Back-Cover Texts as in (a) below. (a) The FSF's Back-Cover Text is: "You are free to copy and modify this GNU Manual. Buying copies from GNU Press supports the FSF in developing GNU and promoting software freedom." --> <!-- Created by GNU Texinfo 6.4, http://www.gnu.org/software/texinfo/ --> <head> <title>Additions to Ada (Debugging with GDB)</title> <meta name="description" content="Additions to Ada (Debugging with GDB)"> <meta name="keywords" content="Additions to Ada (Debugging with GDB)"> <meta name="resource-type" content="document"> <meta name="distribution" content="global"> <meta name="Generator" content="makeinfo"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="index.html#Top" rel="start" title="Top"> <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index"> <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents"> <link href="Ada.html#Ada" rel="up" title="Ada"> <link href="Overloading-support-for-Ada.html#Overloading-support-for-Ada" rel="next" title="Overloading support for Ada"> <link href="Omissions-from-Ada.html#Omissions-from-Ada" rel="prev" title="Omissions from Ada"> <style type="text/css"> <!-- a.summary-letter {text-decoration: none} blockquote.indentedblock {margin-right: 0em} blockquote.smallindentedblock {margin-right: 0em; font-size: smaller} blockquote.smallquotation {font-size: smaller} div.display {margin-left: 3.2em} div.example {margin-left: 3.2em} div.lisp {margin-left: 3.2em} div.smalldisplay {margin-left: 3.2em} div.smallexample {margin-left: 3.2em} div.smalllisp {margin-left: 3.2em} kbd {font-style: oblique} pre.display {font-family: inherit} pre.format {font-family: inherit} pre.menu-comment {font-family: serif} pre.menu-preformatted {font-family: serif} pre.smalldisplay {font-family: inherit; font-size: smaller} pre.smallexample {font-size: smaller} pre.smallformat {font-family: inherit; font-size: smaller} pre.smalllisp {font-size: smaller} span.nolinebreak {white-space: nowrap} span.roman {font-family: initial; font-weight: normal} span.sansserif {font-family: sans-serif; font-weight: normal} ul.no-bullet {list-style: none} --> </style> </head> <body lang="en"> <a name="Additions-to-Ada"></a> <div class="header"> <p> 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> [<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> </div> <hr> <a name="Additions-to-Ada-1"></a> <h4 class="subsubsection">15.4.10.3 Additions to Ada</h4> <a name="index-Ada_002c-deviations-from"></a> <p>As it does for other languages, <small>GDB</small> makes certain generic extensions to Ada (see <a href="Expressions.html#Expressions">Expressions</a>): </p> <ul> <li> If the expression <var>E</var> is a variable residing in memory (typically a local variable or array element) and <var>N</var> is a positive integer, then <code><var>E</var>@<var>N</var></code> displays the values of <var>E</var> and the <var>N</var>-1 adjacent variables following it in memory as an array. In Ada, this operator is generally not necessary, since its prime use is in displaying parts of an array, and slicing will usually do this in Ada. However, there are occasional uses when debugging programs in which certain debugging information has been optimized away. </li><li> <code><var>B</var>::<var>var</var></code> means “the variable named <var>var</var> that appears in function or file <var>B</var>.” When <var>B</var> is a file name, you must typically surround it in single quotes. </li><li> The expression <code>{<var>type</var>} <var>addr</var></code> means “the variable of type <var>type</var> that appears at address <var>addr</var>.” </li><li> A name starting with ‘<samp>$</samp>’ is a convenience variable (see <a href="Convenience-Vars.html#Convenience-Vars">Convenience Vars</a>) or a machine register (see <a href="Registers.html#Registers">Registers</a>). </li></ul> <p>In addition, <small>GDB</small> provides a few other shortcuts and outright additions specific to Ada: </p> <ul> <li> The assignment statement is allowed as an expression, returning its right-hand operand as its value. Thus, you may enter <div class="smallexample"> <pre class="smallexample">(gdb) set x := y + 3 (gdb) print A(tmp := y + 1) </pre></div> </li><li> The semicolon is allowed as an “operator,” returning as its value the value of its right-hand operand. This allows, for example, complex conditional breaks: <div class="smallexample"> <pre class="smallexample">(gdb) break f (gdb) condition 1 (report(i); k += 1; A(k) > 100) </pre></div> </li><li> Rather than use catenation and symbolic character names to introduce special characters into strings, one may instead use a special bracket notation, which is also used to print strings. A sequence of characters of the form ‘<samp>["<var>XX</var>"]</samp>’ within a string or character literal denotes the (single) character whose numeric encoding is <var>XX</var> in hexadecimal. The sequence of characters ‘<samp>["""]</samp>’ also denotes a single quotation mark in strings. For example, <div class="smallexample"> <pre class="smallexample"> "One line.["0a"]Next line.["0a"]" </pre></div> <p>contains an ASCII newline character (<code>Ada.Characters.Latin_1.LF</code>) after each period. </p> </li><li> The subtype used as a prefix for the attributes <tt>'Pos</tt>, <tt>'Min</tt>, and <tt>'Max</tt> is optional (and is ignored in any case). For example, it is valid to write <div class="smallexample"> <pre class="smallexample">(gdb) print 'max(x, y) </pre></div> </li><li> When printing arrays, <small>GDB</small> uses positional notation when the array has a lower bound of 1, and uses a modified named notation otherwise. For example, a one-dimensional array of three integers with a lower bound of 3 might print as <div class="smallexample"> <pre class="smallexample">(3 => 10, 17, 1) </pre></div> <p>That is, in contrast to valid Ada, only the first component has a <code>=></code> clause. </p> </li><li> You may abbreviate attributes in expressions with any unique, multi-character subsequence of their names (an exact match gets preference). For example, you may use <tt>a'len</tt>, <tt>a'gth</tt>, or <tt>a'lh</tt> in place of <tt>a'length</tt>. </li><li> <a name="index-quoting-Ada-internal-identifiers"></a> Since Ada is case-insensitive, the debugger normally maps identifiers you type to lower case. The GNAT compiler uses upper-case characters for some of its internal identifiers, which are normally of no interest to users. For the rare occasions when you actually have to look at them, enclose them in angle brackets to avoid the lower-case mapping. For example, <div class="smallexample"> <pre class="smallexample">(gdb) print <JMPBUF_SAVE>[0] </pre></div> </li><li> Printing an object of class-wide type or dereferencing an access-to-class-wide value will display all the components of the object’s specific type (as indicated by its run-time tag). Likewise, component selection on such a value will operate on the specific type of the object. </li></ul> <hr> <div class="header"> <p> 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> [<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> </div> </body> </html>