gud-mode

gud-mode is an interactive compiled Lisp function in `gud.el'.


(gud-mode)

Parent mode: `comint-mode'.

Major mode for interacting with an inferior debugger process.

You start it up with one of the commands M-x gdb, M-x sdb, M-x dbx,
M-x perldb, M-x xdb, or M-x jdb. Each entry point finishes by executing a
hook; `gdb-mode-hook', `sdb-mode-hook', `dbx-mode-hook',
`perldb-mode-hook', `xdb-mode-hook', or `jdb-mode-hook' respectively.

After startup, the following commands are available in both the GUD
interaction buffer and any source buffer GUD visits due to a breakpoint stop
or step operation:

M-x gud-break sets a breakpoint at the current file and line. In the
GUD buffer, the current file and line are those of the last breakpoint or
step. In a source buffer, they are the buffer's file and current line.

M-x gud-remove removes breakpoints on the current file and line.

C-x C-a C-l displays in the source window the last line referred to
in the gud buffer.

M-x gud-step, M-x gud-next, and M-x gud-stepi do a step-one-line,
step-one-line (not entering function calls), and step-one-instruction
and then update the source window with the current file and position.
M-x gud-cont continues execution.

M-x gud-print tries to find the largest C lvalue or function-call expression
around point, and sends it to the debugger for value display.

The above commands are common to all supported debuggers except xdb which
does not support stepping instructions.

Under gdb, sdb and xdb, M-x gud-tbreak behaves exactly like M-x gud-break,
except that the breakpoint is temporary; that is, it is removed when
execution stops on it.

Under gdb, dbx, and xdb, M-x gud-up pops up through an enclosing stack
frame. M-x gud-down drops back down through one.

If you are using gdb or xdb, M-x gud-finish runs execution to the return from
the current function and stops.

All the keystrokes above are accessible in the GUD buffer
with the prefix C-c, and in all buffers through the prefix C-x C-a.

All pre-defined functions for which the concept make sense repeat
themselves the appropriate number of times if you give a prefix
argument.

You may use the `gud-def' macro in the initialization hook to define other
commands.

Other commands for interacting with the debugger process are inherited from
comint mode, which see.

In addition to any hooks its parent mode `comint-mode' might have run,
this mode runs the hook `gud-mode-hook', as the final step
during initialization.