From unknown Fri Aug 15 02:02:02 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#3845 <3845@debbugs.gnu.org> To: bug#3845 <3845@debbugs.gnu.org> Subject: Status: Several other problems in gdb-mi [RE: bug#3794: Error in json from gdb-ui] Reply-To: bug#3845 <3845@debbugs.gnu.org> Date: Fri, 15 Aug 2025 09:02:02 +0000 retitle 3845 Several other problems in gdb-mi [RE: bug#3794: Error in json = from gdb-ui] reassign 3845 emacs submitter 3845 Dmitry Dzhus severity 3845 normal thanks From dima@sphinx.net.ru Tue Jul 14 06:47:24 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 14 Jul 2009 13:47:24 +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=1.5 required=4.0 tests=AWL,HAS_BUG_NUMBER, IMPRONONCABLE_2,MURPHY_DRUGS_REL8,PHONENUMBER,WWWRU autolearn=no 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 n6EDlJ9l030132 for ; Tue, 14 Jul 2009 06:47:20 -0700 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQiLn-0002gD-5q for bug-gnu-emacs@gnu.org; Tue, 14 Jul 2009 09:47:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQiLg-0002df-VB for bug-gnu-emacs@gnu.org; Tue, 14 Jul 2009 09:47:18 -0400 Received: from [199.232.76.173] (port=59850 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQiLg-0002db-Jp for bug-gnu-emacs@gnu.org; Tue, 14 Jul 2009 09:47:12 -0400 Received: from sphinx.net.ru ([82.146.58.194]:60241) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MQiLf-0006yD-V1 for bug-gnu-emacs@gnu.org; Tue, 14 Jul 2009 09:47:12 -0400 Received: from blizzard (93-81-184-65.broadband.corbina.ru [93.81.184.65]) (authenticated bits=0) by sphinx.net.ru (8.14.3/8.14.2) with ESMTP id n6EDkrmn074809; Tue, 14 Jul 2009 17:46:54 +0400 (MSD) (envelope-from dima@sphinx.net.ru) From: Dmitry Dzhus To: Herbert Euler Cc: <3794@debbugs.gnu.org>, , Nick Roberts Cc: dima@sphinx.net.ru Subject: Re: Several other problems in gdb-mi [RE: bug#3794: Error in json from gdb-ui] References: <87r5wosm7m.fsf@sphinx.net.ru> Date: Tue, 14 Jul 2009 17:46:28 +0400 In-Reply-To: (Herbert Euler's message of "Tue, 14 Jul 2009 09:58:51 +0800") Message-ID: <87zlb71iob.fsf@sphinx.net.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) --=-=-= Herbert Euler wrote: >> > I tried M-x gdb to run emacs under gdb. The command line was >> > >> > gdb -i=mi ~/src/emacs/src/emacs >> > >> > and I got the error '(json-object-format ":" 44). Here is the backtrace: >> >> I could reproduce your problem and I wrote a workaround which fixes the >> bug for me. Could you please try the attached patch for gdb-mi.el? > > That patch works for me, too. Thanks. It's in the trunk now. > 2. The command "shell" is broken: In M-x gdb, > > shell ps aux | grep emacs > > results in no output; but in a "real" gdb, the output looks like this: > > 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=mi emacs > xgp 5353 0.4 0.1 28184 16584 pts/1 S+ 09:49 0:00 gdb -i=mi emacs > xgp 5354 0.0 0.0 52800 976 pts/1 S+ 09:49 0:00 bash -c ps aux | grep emacs > 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 (~, @, & etc.) Thus it's harder to distinguish where this output should go (to GUD buffer, to MI parser etc.) I managed to produce a small patch which does the trick for simple shell commands like yours, 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. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=gdb-shell.patch Content-Description: Print shell command output in GUD buffer (gdbmi-record-list, gdb-shell): Redirect shell command output to GUD buffer (Emacs bug #3794) diff -r 3ba511c84066 gdb-mi.el --- a/gdb-mi.el +++ b/gdb-mi.el @@ -1418,7 +1418,8 @@ (gdb-stopped . "\\*stopped,?\\(.*?\n\\)") (gdb-running . "\\*running,\\(.*?\n\\)") (gdb-thread-created . "=thread-created,\\(.*?\n\\)") - (gdb-thread-exited . "=thread-exited,\\(.*?\n\\)"))) + (gdb-thread-exited . "=thread-exited,\\(.*?\n\\)") + (gdb-shell . "\\(\\(?:^.+\n\\)+\\)"))) (defun gud-gdbmi-marker-filter (string) "Filter GDB/MI output." @@ -1476,7 +1477,10 @@ gdb-filter-output)) (defun gdb-gdb (output-field)) - +(defun gdb-shell (output-field) + (let ((gdb-output-sink gdb-output-sink)) + (setq gdb-filter-output + (concat output-field gdb-filter-output)))) ;; gdb-invalidate-threads is defined to accept 'update-threads signal (defun gdb-thread-created (output-field)) (defun gdb-thread-exited (output-field) --=-=-= > 3. Previously, 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, this does nothing now. I've fixed the code which mimicks RET behaviour for GUD buffer. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=gdb-send-ret.patch Content-Description: Repeat last command on RET properly (gdb-send): Repeat last command on RET properly (Emacs bug #3794). diff -r b45e93199252 gdb-mi.el --- a/gdb-mi.el +++ b/gdb-mi.el @@ -1267,7 +1267,7 @@ (let ((inhibit-read-only t)) (remove-text-properties (point-min) (point-max) '(face)))) ;; mimic key to repeat previous command in GDB - (if (not (string-match "^\\s+$" string)) + (if (not (string= "" string)) (setq gdb-last-command string) (if gdb-last-command (setq string gdb-last-command))) (if gdb-enable-debug --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > As Nick said, this implementation is still in developing. Should I > wait then? It's GSoC project, see http://emacswiki.org/emacs/GDB-MI/ for some details. Don't wait, report bugs of Emacs trunk version as soon as you encounter them, but _please_ file *different* reports for different bugs. I first put really bleeding changes to my Mercurial repo, then commit them to Emacs upstream for further testing. Non-stop debugging support will hit the trunk by the end of this week. --=20 Happy Hacking. http://sphinx.net.ru =E3=82=80 --=-=-=-- From cyd@stupidchicken.com Tue Jul 14 07:46:07 2009 Received: (at control) by emacsbugs.donarmstrong.com; 14 Jul 2009 14:46:08 +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.4 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pantheon-po44.its.yale.edu (pantheon-po44.its.yale.edu [130.132.50.78]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n6EEk4gl008406 for ; Tue, 14 Jul 2009 07:46:05 -0700 Received: from furry (dhcp128036014244.central.yale.edu [128.36.14.244]) (authenticated bits=0) by pantheon-po44.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id n6EEjukd017767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Tue, 14 Jul 2009 10:45:58 -0400 Received: by furry (Postfix, from userid 1000) id 08849C09B; Tue, 14 Jul 2009 10:45:56 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: merge 3840 3845 Date: Tue, 14 Jul 2009 10:45:55 -0400 Message-ID: <87r5wjs4po.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) merge 3840 3845 thanks From rgm@gnu.org Tue Jul 21 19:58:19 2009 Received: (at control) by emacsbugs.donarmstrong.com; 22 Jul 2009 02:58:19 +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.5 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 n6M2wF0x006093 for ; Tue, 21 Jul 2009 19:58:17 -0700 Received: from rgm by fencepost.gnu.org with local (Exim 4.67) (envelope-from ) id 1MTS23-0004iN-1r; Tue, 21 Jul 2009 22:58:15 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19046.32838.974527.846560@fencepost.gnu.org> Date: Tue, 21 Jul 2009 22:58:14 -0400 From: Glenn Morris To: control Subject: control merge 3794 3840 severity 3887 wishlist reassign 3854 emacs,ns severity 3883 minor close 1528 close 1225 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 From unknown Fri Aug 15 02:02:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 20 Dec 2010 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator