GNU bug report logs - #64914
[PATCH] * gdb-mi.el: allow disabling the gdb io buffer

Previous Next

Package: emacs;

Reported by: StrawberryTea <look <at> strawberrytea.xyz>

Date: Fri, 28 Jul 2023 07:12:03 UTC

Severity: wishlist

Tags: moreinfo

Merged with 64913

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 64914 in the body.
You can then email your comments to 64914 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#64914; Package emacs. (Fri, 28 Jul 2023 07:12:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to StrawberryTea <look <at> strawberrytea.xyz>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 28 Jul 2023 07:12:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: StrawberryTea <look <at> strawberrytea.xyz>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
Date: Thu, 27 Jul 2023 20:33:39 -0400
This change allows the user to disable the `gdb-inferior-io' buffer.
This is useful for users that prefer a more classical gdb experience
where you just have the GDB window and the source window.
---
 lisp/progmodes/gdb-mi.el | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index a1091de43e9..0d6d7ab02c0 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1098,9 +1098,10 @@ detailed description of this mode.
                      (if gdb-debuginfod-enable "on" "off"))
              'gdb-debuginfod-message)
 
-  (gdb-get-buffer-create 'gdb-inferior-io)
-  (gdb-clear-inferior-io)
-  (gdb-inferior-io--init-proc (get-process "gdb-inferior"))
+  (when gdb-display-io-buffer
+    (gdb-get-buffer-create 'gdb-inferior-io)
+    (gdb-clear-inferior-io)
+    (gdb-inferior-io--init-proc (get-process "gdb-inferior")))
 
   (when (eq system-type 'windows-nt)
     ;; Don't create a separate console window for the debuggee.
@@ -1828,6 +1829,13 @@ this trigger is subscribed to `gdb-buf-publisher' and called with
   :group 'gdb
   :version "25.1")
 
+(defcustom gdb-display-io-buffer t
+  "When non-nil, display the `gdb-inferior-io' buffer.  Otherwise,
+send program output to the GDB buffer."
+  :type 'boolean
+  :group 'gdb
+  :version "30.1")
+
 (defun gdb-inferior-filter (proc string)
   (unless (string-equal string "")
     (let (buf)
-- 
2.41.0






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64914; Package emacs. (Fri, 28 Jul 2023 11:17:01 GMT) Full text and rfc822 format available.

Message #8 received at 64914 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: StrawberryTea <look <at> strawberrytea.xyz>
Cc: 64914 <at> debbugs.gnu.org
Subject: Re: bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
Date: Fri, 28 Jul 2023 14:17:00 +0300
> From: StrawberryTea <look <at> strawberrytea.xyz>
> Date: Thu, 27 Jul 2023 20:33:39 -0400
> 
> This change allows the user to disable the `gdb-inferior-io' buffer.
> This is useful for users that prefer a more classical gdb experience
> where you just have the GDB window and the source window.

Sorry, I don't think I understand why you need a new defcustom.
Doesn't setting gdb-display-io-nopopup non-nil already achieve what
you want?  It does here.

Thanks.




Merged 64913 64914. Request was from Eli Zaretskii <eliz <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 28 Jul 2023 11:19:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64914; Package emacs. (Fri, 28 Jul 2023 15:41:02 GMT) Full text and rfc822 format available.

Message #13 received at 64914 <at> debbugs.gnu.org (full text, mbox):

From: LemonBreezes <look <at> strawberrytea.xyz>
To: "Eli Zaretskii" <eliz <at> gnu.org>
Cc: 64914 <at> debbugs.gnu.org
Subject: Re: bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
Date: Fri, 28 Jul 2023 10:54:02 -0400
[Message part 1 (text/plain, inline)]
No, setting gdb-display-io-nopopup to nil does not prevent the program IO from being split off into the gdb-inferior-io buffer, nor does it prevent the gdb-inferior-io buffer from popping up when debugging is started. The purpose of setting gdb-display-io-buffer to nil is to prevent the gdb-inferior-io buffer from being created altogether, instead outputting the program output to the GDB buffer itself. A user in the Doom Emacs Discord told me this used to be the behavior of gdb-mi.el but that it was changed without giving the user the option to opt out. I have not investigated that but the comments say that is a feature of GDB 6.4 onward.

On Fri, Jul 28, 2023, at 7:17 AM, Eli Zaretskii wrote:
> > From: StrawberryTea <look <at> strawberrytea.xyz>
> > Date: Thu, 27 Jul 2023 20:33:39 -0400
> > 
> > This change allows the user to disable the `gdb-inferior-io' buffer.
> > This is useful for users that prefer a more classical gdb experience
> > where you just have the GDB window and the source window.
> 
> Sorry, I don't think I understand why you need a new defcustom.
> Doesn't setting gdb-display-io-nopopup non-nil already achieve what
> you want?  It does here.
> 
> Thanks.
> 
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64914; Package emacs. (Fri, 28 Jul 2023 15:49:02 GMT) Full text and rfc822 format available.

Message #16 received at 64914 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: LemonBreezes <look <at> strawberrytea.xyz>
Cc: 64914 <at> debbugs.gnu.org
Subject: Re: bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
Date: Fri, 28 Jul 2023 18:48:28 +0300
> Date: Fri, 28 Jul 2023 10:54:02 -0400
> From: LemonBreezes <look <at> strawberrytea.xyz>
> Cc: 64914 <at> debbugs.gnu.org
> 
> No, setting gdb-display-io-nopopup to nil does not prevent the program IO from being split off into the
> gdb-inferior-io buffer, nor does it prevent the gdb-inferior-io buffer from popping up when debugging is
> started.

I said set it non-nil, not nil. nil is its default value, under which
it does pop up the IO buffer.  You want it not to pop up, so you
should set the variable to t.

> The purpose of setting gdb-display-io-buffer to nil is to prevent the gdb-inferior-io buffer from
> being created altogether, instead outputting the program output to the GDB buffer itself. A user in the
> Doom Emacs Discord told me this used to be the behavior of gdb-mi.el but that it was changed
> without giving the user the option to opt out. I have not investigated that but the comments say that is a
> feature of GDB 6.4 onward.

If the want the old behavior, why do they use gdb-mi at all? why not
use "M-x gud-gdb" instead?  That behaves exactly like the old GDB
interface.

But OK, if someone wants to downgrade gdb-mi this way, why not them
have it.  So I have a comment to your patch:

> +(defcustom gdb-display-io-buffer t
> +  "When non-nil, display the `gdb-inferior-io' buffer.  Otherwise,
> +send program output to the GDB buffer."
> +  :type 'boolean
> +  :group 'gdb
> +  :version "30.1")

The first line of a doc string should be a single complete sentence.

And please describe the behavior in the doc string better: this is not
about displaying the IO buffer, this is about not separating the
program's I/O from the GDB I/O and not redirecting the program's I/O
to a separate buffer.

And finally, please accompany your patch with a ChangeLog-style commit
log message (see CONTRIBUTE for details, if you need them).

Thanks.




Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 13 Feb 2025 08:06:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64914; Package emacs. (Thu, 13 Feb 2025 08:08:01 GMT) Full text and rfc822 format available.

Message #21 received at 64914 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 64914 <at> debbugs.gnu.org, LemonBreezes <look <at> strawberrytea.xyz>
Subject: Re: bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
Date: Thu, 13 Feb 2025 02:07:41 -0600
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Date: Fri, 28 Jul 2023 10:54:02 -0400
>> From: LemonBreezes <look <at> strawberrytea.xyz>
>> Cc: 64914 <at> debbugs.gnu.org
>>
>> No, setting gdb-display-io-nopopup to nil does not prevent the program IO from being split off into the
>> gdb-inferior-io buffer, nor does it prevent the gdb-inferior-io buffer from popping up when debugging is
>> started.
>
> I said set it non-nil, not nil. nil is its default value, under which
> it does pop up the IO buffer.  You want it not to pop up, so you
> should set the variable to t.
>
>> The purpose of setting gdb-display-io-buffer to nil is to prevent the gdb-inferior-io buffer from
>> being created altogether, instead outputting the program output to the GDB buffer itself. A user in the
>> Doom Emacs Discord told me this used to be the behavior of gdb-mi.el but that it was changed
>> without giving the user the option to opt out. I have not investigated that but the comments say that is a
>> feature of GDB 6.4 onward.
>
> If the want the old behavior, why do they use gdb-mi at all? why not
> use "M-x gud-gdb" instead?  That behaves exactly like the old GDB
> interface.

No further updates here within 18 months.

Does that mean that "M-x gud-gdb" is all that is needed to satisfy this
use case?  If not, what is still missing?

> But OK, if someone wants to downgrade gdb-mi this way, why not them
> have it.

I'd actually rather lean towards closing this towards as a wontfix.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64914; Package emacs. (Thu, 13 Feb 2025 08:55:02 GMT) Full text and rfc822 format available.

Message #24 received at 64914 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 64914 <at> debbugs.gnu.org, look <at> strawberrytea.xyz
Subject: Re: bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
Date: Thu, 13 Feb 2025 10:54:41 +0200
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Thu, 13 Feb 2025 02:07:41 -0600
> Cc: LemonBreezes <look <at> strawberrytea.xyz>, 64914 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > But OK, if someone wants to downgrade gdb-mi this way, why not them
> > have it.
> 
> I'd actually rather lean towards closing this towards as a wontfix.

I don't mind, but maybe the OP does.




Added tag(s) moreinfo. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 13 Feb 2025 08:59:02 GMT) Full text and rfc822 format available.

Removed tag(s) patch. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 13 Feb 2025 08:59:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#64914; Package emacs. (Mon, 17 Feb 2025 12:19:01 GMT) Full text and rfc822 format available.

Message #31 received at 64914 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: StrawberryTea <look <at> strawberrytea.xyz>
Cc: 64914 <at> debbugs.gnu.org
Subject: Re: bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
Date: Mon, 17 Feb 2025 14:18:27 +0200
> From: StrawberryTea <look <at> strawberrytea.xyz>
> Date: Sun, 16 Feb 2025 20:24:16 -0500
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Stefan Kangas <stefankangas <at> gmail.com>
> >> Date: Thu, 13 Feb 2025 02:07:41 -0600
> >> Cc: LemonBreezes <look <at> strawberrytea.xyz>, 64914 <at> debbugs.gnu.org
> >>
> >> Eli Zaretskii <eliz <at> gnu.org> writes:
> >>
> >> > But OK, if someone wants to downgrade gdb-mi this way, why not them
> >> > have it.
> >>
> >> I'd actually rather lean towards closing this towards as a wontfix.
> >
> > I don't mind, but maybe the OP does.
> Actually, the patch implementing gdb-display-io-buffer as a configurable
> option was already merged into master a long time ago. It's in Emacs 30.1.

Thanks, closing.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 17 Feb 2025 15:43:02 GMT) Full text and rfc822 format available.

Notification sent to StrawberryTea <look <at> strawberrytea.xyz>:
bug acknowledged by developer. (Mon, 17 Feb 2025 15:43:02 GMT) Full text and rfc822 format available.

Message #36 received at 64914-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 64914-done <at> debbugs.gnu.org
Subject: Re: bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
Date: Mon, 17 Feb 2025 17:41:39 +0200
> Cc: 64914 <at> debbugs.gnu.org
> Date: Mon, 17 Feb 2025 14:18:27 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > From: StrawberryTea <look <at> strawberrytea.xyz>
> > Date: Sun, 16 Feb 2025 20:24:16 -0500
> > 
> > Eli Zaretskii <eliz <at> gnu.org> writes:
> > 
> > >> From: Stefan Kangas <stefankangas <at> gmail.com>
> > >> Date: Thu, 13 Feb 2025 02:07:41 -0600
> > >> Cc: LemonBreezes <look <at> strawberrytea.xyz>, 64914 <at> debbugs.gnu.org
> > >>
> > >> Eli Zaretskii <eliz <at> gnu.org> writes:
> > >>
> > >> > But OK, if someone wants to downgrade gdb-mi this way, why not them
> > >> > have it.
> > >>
> > >> I'd actually rather lean towards closing this towards as a wontfix.
> > >
> > > I don't mind, but maybe the OP does.
> > Actually, the patch implementing gdb-display-io-buffer as a configurable
> > option was already merged into master a long time ago. It's in Emacs 30.1.
> 
> Thanks, closing.
> 
> 
> 
> 




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Mon, 17 Feb 2025 15:43:03 GMT) Full text and rfc822 format available.

Notification sent to StrawberryTea <look <at> strawberrytea.xyz>:
bug acknowledged by developer. (Mon, 17 Feb 2025 15:43:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 18 Mar 2025 11:24:17 GMT) Full text and rfc822 format available.

This bug report was last modified 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.