Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Next: , Previous: Starting GUD, Up: Debuggers

32.6.2 Debugger Operation

When you run a debugger with GUD, the debugger uses an Emacs buffer for its ordinary input and output. This is called the GUD buffer. The debugger displays the source files of the program by visiting them in Emacs buffers. An arrow (‘=>’) in one of these buffers indicates the current execution line.1 Moving point in this buffer does not move the arrow.

You can start editing these source files at any time in the buffers that display them. The arrow is not part of the file's text; it appears only on the screen. If you do modify a source file, keep in mind that inserting or deleting lines will throw off the arrow's positioning; GUD has no way of figuring out which line corresponded before your changes to the line number in a debugger message. Also, you'll typically have to recompile and restart the program for your changes to be reflected in the debugger's tables.

If you wish, you can control your debugger process entirely through the debugger buffer, which uses a variant of Shell mode. All the usual commands for your debugger are available, and you can use the Shell mode history commands to repeat them. See Shell Mode.

The Tooltip facility (see Tooltips) provides support for GUD. You activate this feature by turning on the minor mode gud-tooltip-mode. Then you can display a variable's value in a tooltip simply by pointing at it with the mouse. In graphical mode, with a C program, you can also display the #define directive associated with an identifier when the program is not executing. This operates in the GUD buffer and in source buffers with major modes in the list gud-tooltip-modes. If the variable gud-tooltip-echo-area is non-nil then the variable's value is displayed in the echo area.

With GDB in text command mode (see GDB Graphical Interface), it is possible that use of GUD tooltips can cause a function to be called with harmful side-effects. In this case, Emacs disables them.


[1] Under a window system, the arrow appears in the left fringe of the Emacs window.

  Published under the terms of the GNU General Public License Design by Interspire