emacs-devel
[Top][All Lists]
Advanced

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

Re: gdbui hang


From: Stefan Monnier
Subject: Re: gdbui hang
Date: 11 May 2004 17:37:52 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> (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 via email to

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