From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steve Revilak Newsgroups: gmane.emacs.bugs Subject: bug#6962: 24.0.90; M-x gdb: hangs when leaving the gdb Date: Thu, 6 Oct 2011 20:16:36 -0400 Message-ID: <20111007001636.GA3386@srevilak.net> References: <4C7DCB81.70106@no8wireless.co.nz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ReaqsoxgOBHFXBhH" X-Trace: dough.gmane.org 1317946683 25466 80.91.229.12 (7 Oct 2011 00:18:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 7 Oct 2011 00:18:03 +0000 (UTC) To: 6962@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 07 02:17:58 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RBy8S-00010M-Js for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Oct 2011 02:17:57 +0200 Original-Received: from localhost ([::1]:45150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBy8S-0002eK-0V for geb-bug-gnu-emacs@m.gmane.org; Thu, 06 Oct 2011 20:17:56 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:55853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBy8O-0002eF-TN for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 20:17:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBy8N-0002yS-7u for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 20:17:52 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47489) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBy8N-0002yO-4J for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 20:17:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RBy8X-00089h-Ug for bug-gnu-emacs@gnu.org; Thu, 06 Oct 2011 20:18:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <4C7DCB81.70106@no8wireless.co.nz> Resent-From: Steve Revilak Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Oct 2011 00:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6962 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 6962-submit@debbugs.gnu.org id=B6962.131794663731298 (code B ref 6962); Fri, 07 Oct 2011 00:18:01 +0000 Original-Received: (at 6962) by debbugs.gnu.org; 7 Oct 2011 00:17:17 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBy7o-00088j-7N for submit@debbugs.gnu.org; Thu, 06 Oct 2011 20:17:17 -0400 Original-Received: from asbnvacz-mailrelay01.megapath.net ([207.145.128.243]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBy7f-000884-B6 for 6962@debbugs.gnu.org; Thu, 06 Oct 2011 20:17:10 -0400 Original-Received: from mail8.sea5.speakeasy.net (mail8.sea5.speakeasy.net [69.17.117.53]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 263EDA70653 for <6962@debbugs.gnu.org>; Thu, 6 Oct 2011 20:16:49 -0400 (EDT) Original-Received: (qmail 31933 invoked from network); 7 Oct 2011 00:16:48 -0000 Original-Received: by simscan 1.4.0 ppid: 32268, pid: 30753, t: 5.8379s scanners: clamav: 0.88.2/m:52/d:13495 spam: 3.0.4 Original-Received: from pool-96-237-177-240.bstnma.fios.verizon.net (HELO srevilak.net) (srevilak@[96.237.177.240]) (envelope-sender ) by mail8.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for <6962@debbugs.gnu.org>; 7 Oct 2011 00:16:42 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Thu, 06 Oct 2011 20:18:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:52338 Archived-At: --ReaqsoxgOBHFXBhH Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable This bug report will be sent to the Bug-GNU-Emacs mailing list and the GNU bug tracker at debbugs.gnu.org. Please check that the From: line contains a valid email address. After a delay of up to one day, you should receive an acknowledgement at that address. Please write in English if possible, as the Emacs maintainers usually do not have translators for other languages. Please describe exactly what actions triggered the bug, and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=20 In the emacs 24.0.90 pretest, I've noticed that gdb-mi hangs when quitting the debugger. This seems similar to bug 6962 (opened Sep. 1, 2010), so I'm going file my report under bug 6962. For illustration, I'll use this C program, in file foo.c --------------------------------- #include #include int main(int argc, char ** argv) { if (argc !=3D 2) { exit(1); } return 0; } --------------------------------- I'll compile foo.c as follows: $ make CFLAGS=3D-g foo cc -g foo.c -o foo I'll walk through two examples: one that produces a zero exit code, and one that produces a non-zero exit code. (1) start emacs as follows: emacs -Q foo.c (2) M-x gdb RET Emacs prompts: Run gdb (like this): gdb -i=3Dmi foo Type RET to accept the suggested gdb command line (3) emacs responds with the following: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Current directory is ~/ GNU gdb (GDB) SUSE (7.2-3.3) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-suse-linux". For bug reporting instructions, please see: ... Reading symbols from /home/srevilak/foo...done. (gdb)=20 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (4) at the (gdb) prompt, type=20 =20 b main RET run RET (5) gdb stops at the breakpoint in the first line of main. At the (gdb) prompt type cont RET (6) The *gud-foo* buffer outputs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (gdb) cont Continuing. (gdb) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Note: gdb does not state the the program has exited, and does not report the program's exit code. (7) at the (gdb) prompt, type=20 quit RET At this point, the *gud-foo* buffer hangs, and I have to use C-x k to kill the buffer. * * * That was the non-zero exit case. Here is the zero exit case - M-x gdb RET - press RET at the minibuffer's "Run gdb" message - type "set args x RET" at the (gdb) prompt - type "run RET" at (gdb) prompt - *gud-foo* produces the same output as shown in step (6) - typing "quit RET" at the (gdb) prompt causes *gud-foo* to hang. I feel that there are two issues here: 1. gdb-mi does not state when the debugged program exits. I believe the exit information is very useful to someone debugging a program. For example, I'd like to know that the program exited. 2. "quit RET" causes gdb-mi to hang. It would be nice for gdb-mi to offer feedback here. Like "Debugger finished" or some such. In terms of the expectations behind issues 1. and 2., mine are based on the behavior of M-x gud-gdb. For example, gud-gdb offers something like the following when the debugged program exits: Program exited with code 01. and typing "quit RET" at gud-gdb's (gdb) prompt produces the feedback Debugger finished I think it would be helpful to users if gdb-mi followed these conventions. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /usr/local/emacs-24.0.90.1/share/emacs/24.0.90/etc/DEBUG. In GNU Emacs 24.0.90.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.22.1) of 2011-09-27 on sunny Windowing system distributor `The X.Org Foundation', version 11.0.10903000 configured using `configure '--prefix=3D/usr/local/emacs-24.0.90.1/'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: C value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=3Dlocal locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x r e o p o=20 r t - e m a c s - b u Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr message format-spec rfc822 mml easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader emacsbug time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) --ReaqsoxgOBHFXBhH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAk6OROQACgkQX7YJI4BuyDQSQQCgtrI3WssunkK6/wUfycN8YqXb TP0AoNRZIU72usOw0rcj9sbNzw861SOo =2od0 -----END PGP SIGNATURE----- --ReaqsoxgOBHFXBhH--