Initial bulk commit for "Git on MSys"
[msysgit/historical-msysgit.git] / mingw / info / gdb / Setting.html
blob612d22b8c721b9154f6217789f7ebf2a66d6f516
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="Setting">Setting</a>,
13 Next:<a rel="next" accesskey="n" href="Show.html#Show">Show</a>,
14 Up:<a rel="up" accesskey="u" href="Languages.html#Languages">Languages</a>
15 <hr><br>
16 </div>
18 <h3 class="section">Switching between source languages</h3>
20 <p>There are two ways to control the working language--either have GDB
21 set it automatically, or select it manually yourself. You can use the
22 <code>set language</code> command for either purpose. On startup, GDB
23 defaults to setting the language automatically. The working language is
24 used to determine how expressions you type are interpreted, how values
25 are printed, etc.
27 <p>In addition to the working language, every source file that
28 GDB knows about has its own working language. For some object
29 file formats, the compiler might indicate which language a particular
30 source file is in. However, most of the time GDB infers the
31 language from the name of the file. The language of a source file
32 controls whether C<tt>++</tt> names are demangled--this way <code>backtrace</code> can
33 show each frame appropriately for its own language. There is no way to
34 set the language of a source file from within GDB, but you can
35 set the language associated with a filename extension. See <a href="Show.html#Show">Displaying the language</a>.
37 <p>This is most commonly a problem when you use a program, such
38 as <code>cfront</code> or <code>f2c</code>, that generates C but is written in
39 another language. In that case, make the
40 program use <code>#line</code> directives in its C output; that way
41 GDB will know the correct language of the source code of the original
42 program, and will display that source code, not the generated C code.
44 <ul class="menu">
45 <li><a accesskey="1" href="Filenames.html#Filenames">Filenames</a>: Filename extensions and languages.
46 <li><a accesskey="2" href="Manually.html#Manually">Manually</a>: Setting the working language manually
47 <li><a accesskey="3" href="Automatically.html#Automatically">Automatically</a>: Having GDB infer the source language
48 </ul>
50 </body></html>