From unknown Thu Aug 14 18:37:54 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3993: Several other problems in gdb-mi [RE: bug#3794: Error in json from gdb-ui] Reply-To: Herbert Euler , 3993@debbugs.gnu.org Resent-From: Herbert Euler Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 31 Jul 2009 08:10:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 3993 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.12490276206563 (code B ref -1); Fri, 31 Jul 2009 08:10:07 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 31 Jul 2009 08:07:00 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.2 required=4.0 tests=AWL,HAS_BUG_NUMBER,MULTALT, MURPHY_DRUGS_REL8,PHONENUMBER autolearn=unavailable version=3.2.5-bugs.debian.org_2005_01_02 Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6V86pY2006552 for ; Fri, 31 Jul 2009 01:06:52 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWn8c-0005kL-Nw for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 04:06:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWn8Y-0005ia-LO for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 04:06:50 -0400 Received: from [199.232.76.173] (port=40291 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWn8Y-0005iW-Do for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 04:06:46 -0400 Received: from mx20.gnu.org ([199.232.41.8]:33236) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWn8X-0005Il-OX for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 04:06:46 -0400 Received: from bay0-omc3-s18.bay0.hotmail.com ([65.54.246.218]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MWn8W-0003az-5P for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 04:06:44 -0400 Received: from BAY143-W20 ([65.55.154.55]) by bay0-omc3-s18.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 31 Jul 2009 01:06:42 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_dba245ff-2338-46d8-b2e0-5a5bb1500709_" X-Originating-IP: [124.127.101.0] From: Herbert Euler To: CC: <3794@debbugs.gnu.org>, , Nick Roberts Date: Fri, 31 Jul 2009 16:06:42 +0800 Importance: Normal In-Reply-To: <87zlb71iob.fsf@sphinx.net.ru> References: <87r5wosm7m.fsf@sphinx.net.ru> <87zlb71iob.fsf@sphinx.net.ru> MIME-Version: 1.0 X-OriginalArrivalTime: 31 Jul 2009 08:06:42.0615 (UTC) FILETIME=[D6EDEC70:01CA11B5] X-Detected-Operating-System: by mx20.gnu.org: Windows 2000 SP4, XP SP1+ X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) --_dba245ff-2338-46d8-b2e0-5a5bb1500709_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I'm so sorry for the big delay. I was not able to use computers these days. > > 2. The command "shell" is broken: In M-x gdb=2C > > > > shell ps aux | grep emacs > > > > results in no output=3B but in a "real" gdb=2C the output looks like th= is: > > > > shell ps aux | grep emacs > > &"shell ps aux | grep emacs\n" > > xgp 4886 1.3 0.1 80796 25900 pts/1 T 09:38 0:08 emacs > > xgp 4936 0.3 0.1 77688 22568 pts/10 T+ 09:39 0:02 ./emacs > > xgp 5209 0.0 0.1 28128 16548 pts/6 Ss+ 09:46 0:00 /usr/local/bin/gdb -i= =3Dmi emacs > > xgp 5353 0.4 0.1 28184 16584 pts/1 S+ 09:49 0:00 gdb -i=3Dmi emacs > > xgp 5354 0.0 0.0 52800 976 pts/1 S+ 09:49 0:00 bash -c ps aux | grep em= acs > > xgp 5356 0.0 0.0 51124 688 pts/1 S+ 09:49 0:00 grep emacs > > ^done > > Output of GDB's shell command goes as is straight to the terminal > without being prefixed by stream identifier (~=2C @=2C & etc.) Thus it's > harder to distinguish where this output should go (to GUD buffer=2C to MI > parser etc.) I managed to produce a small patch which does the trick for > simple shell commands like yours=2C but don't expect it to work with > `top(1)` for example. I've attached the patch. Let me know if you notice > that it breaks something. I see. The patch works very well. I got an idea of how to catch the output of `top(1)': Setting up the gud buffer to make it behave like a shell buffer temporarily during the execution of the `shell' command=2C and switching back to make it behave in the gdb way after seen `^done'. However=2C this seems not to be worthy implementing=2C because normally only simple shell commands are executed via the `shell' command. > > 3. Previously=2C typing directly RET at the M-x gdb prompt repeats the > > last command in history. This is also what a "real" gdb does. But in > > the new implementation=2C this does nothing now. > > I've fixed the code which mimicks RET behaviour for GUD buffer. It works for me=2C thank you. And here's another three problems: 4. Killing a gdb buffer won't send the `detach' command to the gdb process=2C leaving the debugged process permentally being stopped. This is often unconvenient. 5. The commands like `while' and `if' cannot be handled correctly. Combined with problem #4=2C this leads to a bad use case: After typing such a command=2C the gdb process hangs=2C so the gdb buffer has to be killed. Then=2C the debugged process hangs and has to be killed. As a result=2C both the debugger and the debugged process have to be restarted. 6. Completion should be done with the emacs completion feature=2C i.e. try-completion=2C completing-read etc. Regards=2C Guanpeng Xu _________________________________________________________________ More than messages=96check out the rest of the Windows Live=99. http://www.microsoft.com/windows/windowslive/= --_dba245ff-2338-46d8-b2e0-5a5bb1500709_ Content-Type: text/html; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable I'm so sorry for the big delay. =3B I was not able to use computers the= se
days.

>=3B >=3B 2. The command "shell" is broken: In M-x g= db=2C
>=3B >=3B
>=3B >=3B shell ps aux | grep emacs
>=3B= >=3B
>=3B >=3B results in no output=3B but in a "real" gdb=2C the= output looks like this:
>=3B >=3B
>=3B >=3B shell ps aux | g= rep emacs
>=3B >=3B &=3B"shell ps aux | grep emacs\n"
>=3B &= gt=3B xgp 4886 1.3 0.1 80796 25900 pts/1 T 09:38 0:08 emacs
>=3B >= =3B xgp 4936 0.3 0.1 77688 22568 pts/10 T+ 09:39 0:02 ./emacs
>=3B >= =3B xgp 5209 0.0 0.1 28128 16548 pts/6 Ss+ 09:46 0:00 /usr/local/bin/gdb -i= =3Dmi emacs
>=3B >=3B xgp 5353 0.4 0.1 28184 16584 pts/1 S+ 09:49 0:= 00 gdb -i=3Dmi emacs
>=3B >=3B xgp 5354 0.0 0.0 52800 976 pts/1 S+ 0= 9:49 0:00 bash -c ps aux | grep emacs
>=3B >=3B xgp 5356 0.0 0.0 511= 24 688 pts/1 S+ 09:49 0:00 grep emacs
>=3B >=3B ^done
>=3B
&= gt=3B Output of GDB's shell command goes as is straight to the terminal
= >=3B without being prefixed by stream identifier (~=2C @=2C &=3B etc.)= Thus it's
>=3B harder to distinguish where this output should go (to = GUD buffer=2C to MI
>=3B parser etc.) I managed to produce a small pat= ch which does the trick for
>=3B simple shell commands like yours=2C b= ut don't expect it to work with
>=3B `top(1)` for example. I've attach= ed the patch. Let me know if you notice
>=3B that it breaks something.=

I see. =3B The patch works very well.

I got an idea of h= ow to catch the output of `top(1)': Setting up the
gud buffer to make it= behave like a shell buffer temporarily during
the execution of the `she= ll' command=2C and switching back to make it
behave in the gdb way after= seen `^done'. =3B However=2C this seems not to
be worthy implementi= ng=2C because normally only simple shell commands
are executed via the `= shell' command.

>=3B >=3B 3. Previously=2C typing directly RET a= t the M-x gdb prompt repeats the
>=3B >=3B last command in history. = This is also what a "real" gdb does. But in
>=3B >=3B the new implem= entation=2C this does nothing now.
>=3B
>=3B I've fixed the code = which mimicks RET behaviour for GUD buffer.

It works for me=2C thank= you.

And here's another three problems:

4. Killing a gdb buf= fer won't send the `detach' command to the gdb
process=2C leaving the de= bugged process permentally being stopped. =3B This
is often unconven= ient.

5. The commands like `while' and `if' cannot be handled correc= tly.
Combined with problem #4=2C this leads to a bad use case: After typ= ing
such a command=2C the gdb process hangs=2C so the gdb buffer has to = be
killed. =3B Then=2C the debugged process hangs and has to be kill= ed. =3B As a
result=2C both the debugger and the debugged process ha= ve to be
restarted.

6. Completion should be done with the emacs c= ompletion feature=2C
i.e. try-completion=2C completing-read etc.

= Regards=2C
Guanpeng Xu



check out the rest of the Wind= ows Live=99. More than mail=96Windows Live=99 goes way beyond your inbox. = More than messages = --_dba245ff-2338-46d8-b2e0-5a5bb1500709_-- From rgm@gnu.org Fri Aug 7 13:30:22 2009 Received: (at control) by emacsbugs.donarmstrong.com; 7 Aug 2009 20:30:22 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-5.0 required=4.0 tests=AWL,ONEWORD,X_DEBBUGS_NO_ACK autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n77KULon031014 for ; Fri, 7 Aug 2009 13:30:22 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MZW4w-00061B-DN; Fri, 07 Aug 2009 16:30:18 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19068.36570.353026.640455@fencepost.gnu.org> Date: Fri, 7 Aug 2009 16:30:18 -0400 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: white X-Ran: t(,5Z",o5I@ZD6sDtvB]$6`On@c%$-Hb|?f<]xW4BVO.uKk]h)z:uu\t^%(`L<:#uRPJ"s X-Debbugs-No-Ack: yes merge 3794 3993 4035 4059 4060 merge 4065 4066 close 4028 reassign 4063 emacs,ns reassign 4070 emacs,ns From rgm@gnu.org Thu Sep 10 10:42:47 2009 Received: (at control) by emacsbugs.donarmstrong.com; 10 Sep 2009 17:42:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.2 required=4.0 tests=AWL,ONEWORD autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n8AHgkMo020451 for ; Thu, 10 Sep 2009 10:42:47 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MlnfR-0004dM-A0; Thu, 10 Sep 2009 13:42:45 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19113.14997.229379.374913@fencepost.gnu.org> Date: Thu, 10 Sep 2009 13:42:45 -0400 From: Glenn Morris To: control Subject: control forcemerge 3794 4389 severity 4382 wishlist reassign 4390 spam reassign 4391 spam From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 21 19:20:02 2010 Received: (at control) by debbugs.gnu.org; 22 Nov 2010 00:20:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKK8Y-0006Nd-3s for submit@debbugs.gnu.org; Sun, 21 Nov 2010 19:20:02 -0500 Received: from pantheon-po41.its.yale.edu ([130.132.50.98]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PKK8V-0006NQ-E8 for control@debbugs.gnu.org; Sun, 21 Nov 2010 19:19:59 -0500 Received: from furball (dhcp128036014014.central.yale.edu [128.36.14.14]) (authenticated bits=0) by pantheon-po41.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id oAM0PCZd017642 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 21 Nov 2010 19:25:13 -0500 Received: by furball (Postfix, from userid 1000) id 744CB1610A5; Sun, 21 Nov 2010 19:25:11 -0500 (EST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 3794 Date: Sun, 21 Nov 2010 19:25:11 -0500 Message-ID: <87r5eep5lk.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) close 3794 thanks