Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / info / gdb / M2-Scope.html
blobe063de00877eda1887f1e42acc00e1edccddb7d8
1 <html lang="en">
2 <head>
3 <title>Debugging with GDB</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="Debugging with GDB">
6 <meta name="generator" content="makeinfo 4.3">
7 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
8 </head>
9 <body>
10 <div class="node">
11 <p>
12 Node:<a name="M2%20Scope">M2 Scope</a>,
13 Next:<a rel="next" accesskey="n" href="GDB-M2.html#GDB%2fM2">GDB/M2</a>,
14 Previous:<a rel="previous" accesskey="p" href="M2-Checks.html#M2%20Checks">M2 Checks</a>,
15 Up:<a rel="up" accesskey="u" href="Modula-2.html#Modula-2">Modula-2</a>
16 <hr><br>
17 </div>
19 <h5 class="subsubsection">The scope operators <code>::</code> and <code>.</code></h5>
21 <p>There are a few subtle differences between the Modula-2 scope operator
22 (<code>.</code>) and the GDB scope operator (<code>::</code>). The two have
23 similar syntax:
25 <pre class="example">
26 <var>module</var> . <var>id</var>
27 <var>scope</var> :: <var>id</var>
28 </pre>
30 <p>where <var>scope</var> is the name of a module or a procedure,
31 <var>module</var> the name of a module, and <var>id</var> is any declared
32 identifier within your program, except another module.
34 <p>Using the <code>::</code> operator makes GDB search the scope
35 specified by <var>scope</var> for the identifier <var>id</var>. If it is not
36 found in the specified scope, then GDB searches all scopes
37 enclosing the one specified by <var>scope</var>.
39 <p>Using the <code>.</code> operator makes GDB search the current scope for
40 the identifier specified by <var>id</var> that was imported from the
41 definition module specified by <var>module</var>. With this operator, it is
42 an error if the identifier <var>id</var> was not imported from definition
43 module <var>module</var>, or if <var>id</var> is not an identifier in
44 <var>module</var>.
46 </body></html>