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=
"Source">Source
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"Data.html#Data">Data
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Stack.html#Stack">Stack
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"index.html#Top">Top
</a>
19 <h2 class=
"chapter">Examining Source Files
</h2>
21 GDB can print parts of your program's source, since the debugging
22 information recorded in the program tells GDB what source files were
23 used to build it. When your program stops, GDB spontaneously prints
24 the line where it stopped. Likewise, when you select a stack frame
25 (see
<a href=
"Selection.html#Selection">Selecting a frame
</a>), GDB prints the line where
26 execution in that frame has stopped. You can print other portions of
27 source files by explicit command.
29 <p>If you use GDB through its
<small>GNU
</small> Emacs interface, you may
30 prefer to use Emacs facilities to view source; see
<a href=
"Emacs.html#Emacs">Using GDB under
<small>GNU
</small> Emacs
</a>.
33 <li><a accesskey=
"1" href=
"List.html#List">List
</a>: Printing source lines
34 <li><a accesskey=
"2" href=
"Search.html#Search">Search
</a>: Searching source files
35 <li><a accesskey=
"3" href=
"Source-Path.html#Source%20Path">Source Path
</a>: Specifying source directories
36 <li><a accesskey=
"4" href=
"Machine-Code.html#Machine%20Code">Machine Code
</a>: Source and machine code