unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org, Miles Bader <miles@gnu.org>
Subject: Re: gdbui hang
Date: 11 May 2004 17:37:52 -0400	[thread overview]
Message-ID: <jwvwu3iu08o.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <16545.16531.713274.678978@nick.uklinux.net>

> (defun gud-kill-buffer-hook ()
>   (when (eq (current-buffer) gud-comint-buffer)
>       (setq gud-minor-mode-type gud-minor-mode)
>       (kill-process (get-buffer-process gud-comint-buffer))))

In general I think the add-hook should not be global but only apply to the
*gud* buffer.  But I must say that I don't understand at all what the
current gud-kill-buffer-hook is doing:

   % grep -nH gud-minor-mode-type  *.el
   gud.el:2504:(defvar gud-minor-mode-type nil)
   gud.el:2512:	 (if (eq gud-minor-mode-type 'gdba)
   gud.el:2549:      (setq gud-minor-mode-type gud-minor-mode)))

It's a variable used in the process sentinel but only set when
a gud-minor-mode buffer is killed.  Sounds pretty odd, yet there's no
comment explaniing what going on.  Sounds like a bug (or some left over
code).

> kill-process sends SIGKILL but I don't know why this kills the inferior (child
> process of gdb) because SIGKILL doesn't do this if I run gdb from an xterm.

I don't know either, but I suspect it has to do with the fact that
terminating the process will also eliminate the tty, so it's more like
killing the whole xterm.

> Shall I commit this change?

Given that it changes the current behavior in ways I don't understand
(because I don't understand the current behavior), I can't tell.
But you might want to check that `get-buffer-process' returns non-nil.


        Stefan

  reply	other threads:[~2004-05-11 21:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-10  4:43 gdbui hang Miles Bader
2004-05-10  6:22 ` Kim F. Storm
2004-05-10 17:30 ` Nick Roberts
2004-05-10 18:16   ` Stefan Monnier
2004-05-10 18:42     ` Nick Roberts
2004-05-11 12:23       ` Richard Stallman
2004-05-11 12:49       ` Miles Bader
2004-05-11 20:25         ` Nick Roberts
2004-05-11 21:08           ` Miles Bader
2004-05-11 21:27             ` Nick Roberts
2004-05-11 21:40             ` Stefan Monnier
2004-05-10 17:41 ` Nick Roberts
2004-05-10 19:09   ` Stefan Monnier
2004-05-11 21:07     ` Nick Roberts
2004-05-11 21:37       ` Stefan Monnier [this message]
2004-05-11 22:43         ` Nick Roberts
2004-05-11 23:23           ` Stefan Monnier
2004-05-12 12:40             ` Kim F. Storm
2004-05-12 14:59               ` Stefan Monnier

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=jwvwu3iu08o.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=miles@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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