unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
@ 2023-07-28  0:33 StrawberryTea
  2023-07-28 11:17 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: StrawberryTea @ 2023-07-28  0:33 UTC (permalink / raw)
  To: 64914

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







^ permalink raw reply related	[flat|nested] 4+ messages in thread

* bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
  2023-07-28  0:33 bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer StrawberryTea
@ 2023-07-28 11:17 ` Eli Zaretskii
  2023-07-28 14:54   ` LemonBreezes
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-07-28 11:17 UTC (permalink / raw)
  To: StrawberryTea; +Cc: 64914

> From: StrawberryTea <look@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
  2023-07-28 11:17 ` Eli Zaretskii
@ 2023-07-28 14:54   ` LemonBreezes
  2023-07-28 15:48     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: LemonBreezes @ 2023-07-28 14:54 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 64914

[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]

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@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.
> 

[-- Attachment #2: Type: text/html, Size: 1681 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer
  2023-07-28 14:54   ` LemonBreezes
@ 2023-07-28 15:48     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-07-28 15:48 UTC (permalink / raw)
  To: LemonBreezes; +Cc: 64914

> Date: Fri, 28 Jul 2023 10:54:02 -0400
> From: LemonBreezes <look@strawberrytea.xyz>
> Cc: 64914@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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-28 15:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-28  0:33 bug#64914: [PATCH] * gdb-mi.el: allow disabling the gdb io buffer StrawberryTea
2023-07-28 11:17 ` Eli Zaretskii
2023-07-28 14:54   ` LemonBreezes
2023-07-28 15:48     ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).