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">
12 Node:
<a name=
"Automatically">Automatically
</a>,
13 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Manually.html#Manually">Manually
</a>,
14 Up:
<a rel=
"up" accesskey=
"u" href=
"Setting.html#Setting">Setting
</a>
18 <h4 class=
"subsection">Having GDB infer the source language
</h4>
20 <p>To have GDB set the working language automatically, use
21 <code>set language local
</code> or
<code>set language auto
</code>. GDB
22 then infers the working language. That is, when your program stops in a
23 frame (usually by encountering a breakpoint), GDB sets the
24 working language to the language recorded for the function in that
25 frame. If the language for a frame is unknown (that is, if the function
26 or block corresponding to the frame was defined in a source file that
27 does not have a recognized extension), the current working language is
28 not changed, and GDB issues a warning.
30 <p>This may not seem necessary for most programs, which are written
31 entirely in one source language. However, program modules and libraries
32 written in one source language can be used by a main program written in
33 a different source language. Using
<code>set language auto
</code> in this
34 case frees you from having to set the working language manually.