We can define a bunch of bindings for gud-mode through gud-mode-map
. But it seems these bindings only hold when the active window is one of the dedicated gdb windows (or simply the comint window if you're not using many-windows).
I can't find any keymap that is active for the source code being debugged -- the only minor mode that seems to be active is gdb-many-windows-mode. That does not have a keymap however. So I tried redefining it:
(define-minor-mode gdb-many-windows
"Redefine many windows to include a keymap"
:global t
:group 'gdb
:version "22.1"
:keymap my-customized-gdb-mode-map
(if (and gud-comint-buffer
(buffer-name gud-comint-buffer))
(ignore-errors
(gdb-restore-windows))))
But then I realized this is an always-active global mode. So how would I go about customizing keybindngs that are active for the source buffer??