From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Herbert Euler Newsgroups: gmane.emacs.bugs Subject: bug#3794: Several other problems in gdb-mi [RE: bug#3794: Error in json from gdb-ui] Date: Fri, 31 Jul 2009 16:06:42 +0800 Message-ID: References: <87r5wosm7m.fsf@sphinx.net.ru> <87zlb71iob.fsf@sphinx.net.ru> Reply-To: Herbert Euler , 3794@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_dba245ff-2338-46d8-b2e0-5a5bb1500709_" X-Trace: ger.gmane.org 1249029986 1118 80.91.229.12 (31 Jul 2009 08:46:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Jul 2009 08:46:26 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org, 3794@emacsbugs.donarmstrong.com To: Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jul 31 10:46:19 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MWnko-0002nS-7t for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Jul 2009 10:46:18 +0200 Original-Received: from localhost ([127.0.0.1]:52058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWnkn-0003sB-JV for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Jul 2009 04:46:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MWnkg-0003pw-L5 for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 04:46:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MWnkd-0003mZ-Se for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 04:46:10 -0400 Original-Received: from [199.232.76.173] (port=57270 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MWnkd-0003mO-Lr for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 04:46:07 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:44749) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MWnkd-0005t0-77 for bug-gnu-emacs@gnu.org; Fri, 31 Jul 2009 04:46:07 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6V8QiEw008562; Fri, 31 Jul 2009 01:26:45 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n6V8AGZ5006884; Fri, 31 Jul 2009 01:10:16 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Herbert Euler Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 31 Jul 2009 08:10:15 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3794 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3794-submit@emacsbugs.donarmstrong.com id=B3794.12490276176558 (code B ref 3794); Fri, 31 Jul 2009 08:10:15 +0000 Original-Received: (at 3794) by emacsbugs.donarmstrong.com; 31 Jul 2009 08:06:57 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from bay0-omc3-s18.bay0.hotmail.com (bay0-omc3-s18.bay0.hotmail.com [65.54.246.218]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6V86mJ1006533 for <3794@emacsbugs.donarmstrong.com>; Fri, 31 Jul 2009 01:06:49 -0700 Original-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 X-Originating-IP: [124.127.101.0] Importance: Normal In-Reply-To: <87zlb71iob.fsf@sphinx.net.ru> X-OriginalArrivalTime: 31 Jul 2009 08:06:42.0615 (UTC) FILETIME=[D6EDEC70:01CA11B5] X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Fri, 31 Jul 2009 04:46:10 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:29758 Archived-At: --_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_--