unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: Gud keybindings
Date: Wed, 13 Aug 2014 21:14:08 +0200	[thread overview]
Message-ID: <87ha1gtd6n.fsf@debian.uxu> (raw)
In-Reply-To: mailman.7049.1407907858.1147.help-gnu-emacs@gnu.org

Yuri Khan <yuri.v.khan@gmail.com> writes:

> * 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?

For what modes do you want it?

For one or but a few, how about binding the self-insert
keys to either self-insert, or, if buffer-read-only (or
`Gud-alive-p' if such a predicate exists - otherwise
write it). I don't think that'll be too slow/much work
for just a couple of keys.

If it is, you can write a defun, we-are-debugging which
rebinds the keys, and correspondingly no-bugs-left to
reset. You can automatize this second part like, if a
non-debug key is pressed, it is not only self-inserted,
it also disables the debugging keys.

Check out this minor-mode - it works just like that.
Enable it to get new keys. Disable it to get back to
normal. Or do something that makes sense normally, but
not with the minor-mode on - that gets implemented
"normally", and disables the minor mode as well.
Straight Ghostbusters!

For Emacs:
http://user.it.uu.se/~embe8573/conf/emacs-init/caps.el

Same thing, for zsh:
http://user.it.uu.se/~embe8573/conf/.zsh/caps

> 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.

Yeah, you got GDB to work with C++ on Linux? I asked
about it on gnu.gdb.bug and it seems the post is
archived here:

http://www.archivum.info/gnu.gdb.bug/2013-09/00000/C++-linux-gate.so.1-'set-solib-search-path'-and-'set-sysroot'.html

(Wow, that's a long URL.)

For whatever reason the reply I got isn't available,
but he said something to the effect "that's a bug,
report it". But I take it GDB is written in C so
nothing would have stopped me from using it to debug
itself...

-- 
underground experts united


       reply	other threads:[~2014-08-13 19:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.7049.1407907858.1147.help-gnu-emacs@gnu.org>
2014-08-13 19:14 ` Emanuel Berg [this message]
2014-08-14  3:48   ` Gud keybindings Yuri Khan
     [not found]   ` <mailman.7092.1407988122.1147.help-gnu-emacs@gnu.org>
2014-08-14 21:13     ` Emanuel Berg
2014-08-13  5:30 Yuri Khan
2014-08-18  9:27 ` Yuri Khan
2014-08-19  1:49   ` Stefan Monnier
2014-08-19  5:03     ` Yuri Khan
     [not found] ` <mailman.7183.1408354083.1147.help-gnu-emacs@gnu.org>
2014-08-18 22:56   ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ha1gtd6n.fsf@debian.uxu \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).