[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gud keybindings
From: |
Yuri Khan |
Subject: |
Re: Gud keybindings |
Date: |
Tue, 19 Aug 2014 12:03:36 +0700 |
On Tue, Aug 19, 2014 at 8:49 AM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> I was unable to solve all issues using only documented APIs and had to
>> advise a couple of functions.
>
> We generally consider this as a bug. So please M-x report-emacs-bug,
> explaining the functionality/hook that you failed to find.
18294.
> Note that the issue you're trying to solve with Gud key-bindings is an
> issue that we also want to solve in Emacs (especially since in
> Emacs-24.4, C-x SPC is not bound to gud-break any more). It's just not
> easy to solve in general:
> - if you use M-x gud-gdb instead of M-x gdb, then gdb-source-file-list
> doesn't exist).
This turns out unimportant, for two reasons:
* Advising “gdb-init-buffer” is sufficient to turn on the mode in both
existing source buffers and source buffers created during debugging; I
don’t even have to hook “find-file-hook”.
* Using “gud-gdb”, “gdb-init-buffer” is never called at all, and
clicking in the fringe does not set breakpoints. This is
understandable because gud-gdb supports concurrent debugging sessions
and it’s kind of hard to decide which debugger instance the breakpoint
goes to. In the same way, pressing a debugger control key while in a
source buffer should effect an action in one of the debuggers, but
which one?
Due to the latter issue being hard, I am inclined to leave gud-gdb
unsupported by now.
> - I pretty much always have a Gud buffer open (when I'm done debugging,
> I generally don't kill the buffer, because I know I'll get back to it
> soon for something else).
Killing the Gud interaction buffer is not necessary. “gdb-reset” runs
when the “quit” command is executed in gdb. (Not when the program
under debugger finishes: Gud assumes you’re still debugging.)
With the default keybindings, it is possible to leave a debugging
session open, edit some files, recompile, re-run and continue
debugging. In my model, though, an active debugging session prevents
source files from being edited (because it hijacks single-letter
keystrokes to control the debugger). Anyway, one could manually toggle
the mode off if needed.