On startup, GUD runs one of the following hooks:
gdb-mode-hook, if you are using GDB;
you are using DBX;
sdb-mode-hook, if you are using SDB;
xdb-mode-hook, if you are using XDB;
for Guile REPL debugging;
perldb-mode-hook, for Perl debugging
pdb-mode-hook, for PDB;
jdb-mode-hook, for JDB.
gud-def Lisp macro (see Defining Macros) provides a convenient way to define an
Emacs command that sends a particular command string to the debugger,
and set up a key binding for in the GUD interaction buffer:
(gud-def function cmdstring binding docstring)
This defines a command named function which sends
cmdstring to the debugger process, and gives it the documentation
string docstring. You can then use the command function in any
buffer. If binding is non-
gud-def also binds
the command to C-c binding in the GUD buffer's mode and to
C-x C-a binding generally.
The command string cmdstring may contain certain ‘%’-sequences that stand for data to be filled in at the time function is called:
If you don't use ‘%p’ in the command string, the command you define
ignores any numeric argument.