[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Gud keybindings

From: Yuri Khan
Subject: Gud keybindings
Date: Wed, 13 Aug 2014 12:30:54 +0700

Hello list,

I am trying to debug C++ programs using Emacs, Gud and GDB. This
involves setting breakpoints, stepping through and over function
calls, and examining variables.

By executing (gdb-many-windows) I can see the usual six Gud windows:
GDB interaction, variables, source, in/output, stack, and breakpoints.

I can focus the source buffer and navigate the source. In the source
buffer, I can use such keybindings as C-x C-a C-b to set a breakpoint,
and C-x C-a C-n to run until the next line.

This set of keybindings strikes me as very unintuitive and
inefficient. As a user coming from a different IDE, I would like such
keys as Ctrl+F2 to set a breakpoint, F7/F8 for “step” and “next”, and
Ctrl+F9 for “continue”. Or as a user familiar with console GDB, I
might like to press “b”, “s”, “n” and “c” in the source window to
invoke those same actions, but now they just act as

My two questions are:

* Surely I am not the first user who wants easy debugging keys? What
existing solutions are there? Or does everybody just (global-set-key
(kbd "f8") 'gud-next)?

* What would I need to do if I wanted to implement single-letter key
bindings for Gud commands? Define a minor mode with an appropriate
keymap that sets buffer-read-only when enabled and restores it when
disabled? How do I arrange for this mode to be enabled when visiting
any source buffer if and only if Gud is active?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]