Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / info / gdb / Manually.html
blob9b91ce52c0a9c181e7609f977465961a11666471
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="Manually">Manually</a>,
13 Next:<a rel="next" accesskey="n" href="Automatically.html#Automatically">Automatically</a>,
14 Previous:<a rel="previous" accesskey="p" href="Filenames.html#Filenames">Filenames</a>,
15 Up:<a rel="up" accesskey="u" href="Setting.html#Setting">Setting</a>
16 <hr><br>
17 </div>
19 <h4 class="subsection">Setting the working language</h4>
21 <p>If you allow GDB to set the language automatically,
22 expressions are interpreted the same way in your debugging session and
23 your program.
25 <p>If you wish, you may set the language manually. To do this, issue the
26 command <code>set language </code><var>lang</var><code></code>, where <var>lang</var> is the name of
27 a language, such as
28 <code>c</code> or <code>modula-2</code>.
29 For a list of the supported languages, type <code>set language</code>.
31 <p>Setting the language manually prevents GDB from updating the working
32 language automatically. This can lead to confusion if you try
33 to debug a program when the working language is not the same as the
34 source language, when an expression is acceptable to both
35 languages--but means different things. For instance, if the current
36 source file were written in C, and GDB was parsing Modula-2, a
37 command such as:
39 <pre class="example"> print a = b + c
40 </pre>
42 <p>might not have the effect you intended. In C, this means to add
43 <code>b</code> and <code>c</code> and place the result in <code>a</code>. The result
44 printed would be the value of <code>a</code>. In Modula-2, this means to compare
45 <code>a</code> to the result of <code>b+c</code>, yielding a <code>BOOLEAN</code> value.
47 </body></html>