(emacs)GUD Customization

Prev: Commands of GUD Up: Debuggers

GUD Customization

   On startup, GUD runs one of the following hooks: `gdb-mode-hook', if
you are using GDB; `dbx-mode-hook', if you are using DBX;
`sdb-mode-hook', if you are using SDB; and `xdb-mode-hook', if you are
using XDB.  You can use these hooks to define custom keybindings for
the debugger interaction buffer.  Note: Hooks.

   Here is a convenient way to define a command that sends a particular
command string to the debugger, and set up a key binding for it in the
debugger interaction buffer:


   This defines a command named FUNCTION which sends CMDSTRING to the
debugger process, with documentation string DOCSTRING.  You can use the
command thus defined in any buffer.  If BINDING is non-`nil', `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 escape sequences
that are filled in with varying data at the time FUNCTION is called:

     Name of the current source file.  If the current buffer is the GUD
     buffer, then the "current source file" is the file that the
     program stopped in.

     Number of the current source line.  If the current buffer is the
     GUD buffer, then the "current source line" is the line that the
     program stopped in.

     Text of the C lvalue or function-call expression surrounding point.

     Text of the hexadecimal address surrounding point.

     Prefix (numeric) argument of the called function (if any) as a
     number.  (If you don't use `%p' in the command string, the command
     you define ignores any prefix argument.)

automatically generated by info2www