164Chapter5 • Working with GNU Debugger
5.9Using gdb With GNU Emacs
If you use GNU Emacs to edit your programs, you can also create a debug window within
Emacs using the
M-x gdb
command. Let us suppose that you are editing
sumf.c
program in
GNU Emacs as shown in Figure 5-1.
Now when you use
M-x gdb
command, you will see that the Emacs window is split and
the bottom part is used as the
gdb
window. The screen shot in Figure 5-2 shows this new Emacs
window. You can also see that new menus appear in the menu bar at the top of the screen. You
can use these menus for the usual debugging functions like creating break points, starting and
stopping the debug process and so on. The Gud menu is especially of interest for program
debugging.
Figure5-1 Editing
sumf.c
program in GNU Emacs.