toolchain/share/doc/gdb/GDB_002fM2.html

69 lines
3.4 KiB
HTML
Raw Permalink Normal View History

2024-01-10 05:24:32 +00:00
<html lang="en">
<head>
<title>GDB/M2 - Debugging with GDB</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Debugging with GDB">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Modula_002d2.html#Modula_002d2" title="Modula-2">
<link rel="prev" href="M2-Scope.html#M2-Scope" title="M2 Scope">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<!--
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.''
-->
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
pre.display { font-family:inherit }
pre.format { font-family:inherit }
pre.smalldisplay { font-family:inherit; font-size:smaller }
pre.smallformat { font-family:inherit; font-size:smaller }
pre.smallexample { font-size:smaller }
pre.smalllisp { font-size:smaller }
span.sc { font-variant:small-caps }
span.roman { font-family:serif; font-weight:normal; }
span.sansserif { font-family:sans-serif; font-weight:normal; }
--></style>
</head>
<body>
<div class="node">
<a name="GDB%2fM2"></a>
<a name="GDB_002fM2"></a>
<p>
Previous:&nbsp;<a rel="previous" accesskey="p" href="M2-Scope.html#M2-Scope">M2 Scope</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Modula_002d2.html#Modula_002d2">Modula-2</a>
<hr>
</div>
<h5 class="subsubsection">15.4.9.9 <span class="sc">gdb</span> and Modula-2</h5>
<p>Some <span class="sc">gdb</span> commands have little use when debugging Modula-2 programs.
Five subcommands of <code>set print</code> and <code>show print</code> apply
specifically to C and C<tt>++</tt>: &lsquo;<samp><span class="samp">vtbl</span></samp>&rsquo;, &lsquo;<samp><span class="samp">demangle</span></samp>&rsquo;,
&lsquo;<samp><span class="samp">asm-demangle</span></samp>&rsquo;, &lsquo;<samp><span class="samp">object</span></samp>&rsquo;, and &lsquo;<samp><span class="samp">union</span></samp>&rsquo;. The first four
apply to C<tt>++</tt>, and the last to the C <code>union</code> type, which has no direct
analogue in Modula-2.
<p>The <code>@</code> operator (see <a href="Expressions.html#Expressions">Expressions</a>), while available
with any language, is not useful with Modula-2. Its
intent is to aid the debugging of <dfn>dynamic arrays</dfn>, which cannot be
created in Modula-2 as they can in C or C<tt>++</tt>. However, because an
address can be specified by an integral constant, the construct
&lsquo;<samp><span class="samp">{</span><var>type</var><span class="samp">}</span><var>adrexp</var></samp>&rsquo; is still useful.
<p><a name="index-g_t_0040code_007b_0023_007d-in-Modula_002d2-1055"></a>In <span class="sc">gdb</span> scripts, the Modula-2 inequality operator <code>#</code> is
interpreted as the beginning of a comment. Use <code>&lt;&gt;</code> instead.
</body></html>