From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: gdbui hang Date: 11 May 2004 17:37:52 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <16543.48815.692499.486290@nick.uklinux.net> <87fza8qewy.fsf-monnier+emacs@gnu.org> <16545.16531.713274.678978@nick.uklinux.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1084312107 20088 80.91.224.253 (11 May 2004 21:48:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 11 May 2004 21:48:27 +0000 (UTC) Cc: emacs-devel@gnu.org, Miles Bader Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue May 11 23:48:23 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNf6s-0004LS-00 for ; Tue, 11 May 2004 23:48:22 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BNf6s-0006FX-00 for ; Tue, 11 May 2004 23:48:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNf2R-0006G1-TR for emacs-devel@quimby.gnus.org; Tue, 11 May 2004 17:43:47 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BNf0i-0005jO-FY for emacs-devel@gnu.org; Tue, 11 May 2004 17:42:00 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BNewl-0004ac-6X for emacs-devel@gnu.org; Tue, 11 May 2004 17:38:27 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BNewk-0004aU-Rm; Tue, 11 May 2004 17:37:54 -0400 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 50299204BE; Tue, 11 May 2004 17:37:52 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 3E96D8C6AE; Tue, 11 May 2004 17:37:52 -0400 (EDT) Original-To: Nick Roberts In-Reply-To: <16545.16531.713274.678978@nick.uklinux.net> Original-Lines: 35 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=-0.908, requis 5, BAYES_10 -0.91) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:23182 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:23182 > (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