From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: StrawberryTea Newsgroups: gmane.emacs.bugs Subject: bug#65007: [PATCH] Allow displaying program IO in the GDB buffer. Date: Thu, 27 Jul 2023 20:33:39 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12639"; mail-complaints-to="usenet@ciao.gmane.io" To: 65007@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 02 10:07:34 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qR6tD-0002zk-TK for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Aug 2023 10:07:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qR6sr-0004T4-QQ; Wed, 02 Aug 2023 04:07:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qR6so-0004SM-LG for bug-gnu-emacs@gnu.org; Wed, 02 Aug 2023 04:07:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qR6so-0008MZ-C7 for bug-gnu-emacs@gnu.org; Wed, 02 Aug 2023 04:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qR6sn-0002sS-TU for bug-gnu-emacs@gnu.org; Wed, 02 Aug 2023 04:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: StrawberryTea Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Aug 2023 08:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65007 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.169096360311019 (code B ref -1); Wed, 02 Aug 2023 08:07:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Aug 2023 08:06:43 +0000 Original-Received: from localhost ([127.0.0.1]:48812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qR6sU-0002rb-Te for submit@debbugs.gnu.org; Wed, 02 Aug 2023 04:06:43 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:57352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qR3sP-0005v4-6d for submit@debbugs.gnu.org; Wed, 02 Aug 2023 00:54:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qR3sJ-0006NT-RQ for bug-gnu-emacs@gnu.org; Wed, 02 Aug 2023 00:54:19 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qR3sH-0001x7-UB for bug-gnu-emacs@gnu.org; Wed, 02 Aug 2023 00:54:19 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B6B5F5C013E for ; Wed, 2 Aug 2023 00:54:12 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 02 Aug 2023 00:54:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= strawberrytea.xyz; h=cc:content-type:content-type:date:date:from :from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to; s=fm1; t=1690952052; x=1691038452; bh=Fm D8frhEnHbpry/ehocAsy3cCeRzthmrOU48jNMWHE4=; b=W3EbxIZ3vdtpQr0GKL 9QetPSZoIGsjpNzKLLhN7lSXgVi4dV4ChfN8zARYCjRz+Nwj1s+bsdLOX8rh/kOQ ZlO5bJt9aO9ELDWlYrtb1XOgM+RVjMy3vJajaNUCuMJhIHyhBzKoPP81wC5vgUy/ ffFKH3JtvnMaJTMWfhVomopq22c2TSvF3BhvfXO9OMPgW1zfbZT7cd/ayplRL1Kg tc8EeiDf/vGj6gMvBt0TpEqfQLunFddyfLFCqGSPNU8i4H41q+sufDxRFocWevZQ lOvI15yswQsKW0XeZ0Jio9yUSLxIedJCx+pqqfhZyeAc403/TONBITWLhzW9F/iy i/Dw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1690952052; x=1691038452; bh=FmD8frhEnHbpry/ehocAsy3cCeRzthmrOU4 8jNMWHE4=; b=O327NUkL+jrCcOTAeezDDKtL0ctmtgsCUTC+pOdbecU/WCrKc/V vzx2eYb/9GAL5EcYwZnXmH8xRDuSHDfqdR7/BKkQyAXiHohYKjUSthKbtPKftk4p YP/9TNUsTPOEHIeWn75f+eePb4aCvEOU/O6Z5Ue365WrUOR4Duj4vOAty7Y0bq74 l9SdETjTYeJBQlONZV4K3vt70lkYdgLDnhX9Da2lfZHe91VAYJmsjR+KqHvnLMcH W/O2/O9M6GSBRs/wxnTS7PTu6vTa23TRWIaWEaZTX/BUm4fvrcEkXimq/Ny6XGx9 Ej5OwUO5OvcmPMUlkFg2nyk/y/acQEW3F0A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrjeejgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdejtddmnecujfgurhephffvuf ffkfggtgesthdtredttddttdenucfhrhhomhepufhtrhgrfigsvghrrhihvfgvrgcuoehl ohhokhesshhtrhgrfigsvghrrhihthgvrgdrgiihiieqnecuggftrfgrthhtvghrnheptd fgueffhffhgffhjefghedvheefkeefheekfeeiveegveegfeevudeuhfehleffnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhhoohhksehsth hrrgifsggvrhhrhihtvggrrdighiii X-ME-Proxy: Feedback-ID: id85149b6:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 2 Aug 2023 00:54:12 -0400 (EDT) Received-SPF: pass client-ip=66.111.4.28; envelope-from=look@strawberrytea.xyz; helo=out4-smtp.messagingengine.com X-Spam_score_int: 6 X-Spam_score: 0.6 X-Spam_bar: / X-Spam_report: (0.6 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_96_XX=3.405, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 02 Aug 2023 04:06:42 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:266486 Archived-At: * gdb-mi.el: Add new customizable variable `gdb-split-io-flag'. This change allows the user to control whether program IO is displayed in the GDB buffer or in a separate buffer. The default is to display it in the the `gdb-inferior-io' buffer. --- lisp/progmodes/gdb-mi.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index a1091de43e9..8f4f06abb9a 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-split-io-flag + (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,15 @@ this trigger is subscribed to `gdb-buf-publisher' and called with :group 'gdb :version "25.1") +(defcustom gdb-split-io-flag t + "Non-nil means to split the program's I/O from the GDB buffer. + +If t, create the `gdb-inferior-io' buffer and redirect the +program's I/O to it." + :type 'boolean + :group 'gdb + :version "30.1") + (defun gdb-inferior-filter (proc string) (unless (string-equal string "") (let (buf) -- 2.41.0