From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Using gdb (windows popping up) Date: Sun, 09 Jun 2019 22:13:08 +0300 Message-ID: <83ef42bmij.fsf@gnu.org> References: <20190609115246.41281b50@mistral> <83ftoibofg.fsf@gnu.org> <20190609145921.0fc60f3c@mistral> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="22048"; mail-complaints-to="usenet@blaine.gmane.org" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jun 09 21:13:59 2019 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ha3GP-0005aI-W2 for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Jun 2019 21:13:58 +0200 Original-Received: from localhost ([::1]:37786 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha3GO-0006bo-Gg for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Jun 2019 15:13:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57769) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha3G2-0006Z9-EI for help-gnu-emacs@gnu.org; Sun, 09 Jun 2019 15:13:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ha3G2-0006fp-6j for help-gnu-emacs@gnu.org; Sun, 09 Jun 2019 15:13:34 -0400 Original-Received: from [176.228.60.248] (port=4071 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ha3Fy-0001pR-PF for help-gnu-emacs@gnu.org; Sun, 09 Jun 2019 15:13:34 -0400 In-reply-to: <20190609145921.0fc60f3c@mistral> (message from jonetsu on Sun, 9 Jun 2019 14:59:21 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:120878 Archived-At: > Date: Sun, 9 Jun 2019 14:59:21 -0400 > From: jonetsu > > > As yet another alternative, customize gdb-show-main to a non-nil > > value, and then "M-x gdb" will automatically show the source file with > > the main function in a window; switch in that window to your other > > source file where you want to set a breakpoint, then start the > > program. > > Yes, gdb-show-main is set to non-nil. And yes, it will then show the > source beside the gdb interactive buffer.... until a printf/cout > statement is issued at which point the input/output window will > "aggressively" - as it was termed in a Stack Exchange topic - take over > and decide where any other buffer you deem to see will be actually > located. That's a different issue. Your original complaint was about popping up source buffers, and that's what I was trying to help you with. > Fortunately, the fix I found, setting gdb-display-io-nopopup > (starting at emacs 25) to non-nil solves the issue and brings back > peace of mind regarding the expected freedom one expects in emacs > regarding placing buffers where one wants them. In other words, if > removes a good part of the tool's quirks in this context and enables > one to concentrate on work. So the problem is solved. I'm glad. My personal advice is to start the debugging session with "M-x gdb-many-windows", which will open all the UI windows, including I/O. I believe in this case the program's output will be inserted into the I/O window, and will not usurp any of your other windows. > That such behaviour found its way in emacs is something else. Imagine > any power tool built wit such quirkiness. Once again, the GDB-MI UI was designed to work with dedicated windows, to mimic GUI front ends to debuggers. The user manual even advises to start "M-x gdb" in a separate frame, so as not to interfere with any window arrangement you may be using when not debugging.