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 21:31:47 +0300 Message-ID: <83ftoibofg.fsf@gnu.org> References: <20190609115246.41281b50@mistral> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="125551"; 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 20:32:33 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 1ha2cJ-000WUf-GH for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Jun 2019 20:32:31 +0200 Original-Received: from localhost ([::1]:37392 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha2cD-0002IM-5G for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Jun 2019 14:32:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48396) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1ha2c0-0002I4-BG for help-gnu-emacs@gnu.org; Sun, 09 Jun 2019 14:32:13 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34643) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ha2c0-0003rp-8D for help-gnu-emacs@gnu.org; Sun, 09 Jun 2019 14:32:12 -0400 Original-Received: from [176.228.60.248] (port=1561 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ha2bw-0007Rt-Ha for help-gnu-emacs@gnu.org; Sun, 09 Jun 2019 14:32:12 -0400 In-reply-to: <20190609115246.41281b50@mistral> (message from jonetsu on Sun, 9 Jun 2019 11:52:46 -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:120876 Archived-At: > Date: Sun, 9 Jun 2019 11:52:46 -0400 > From: jonetsu > > The gdb session starts (M-x gdb) with on the left gdb and on the right > the source. In the source a breakpoint can be placed in the margin. > All fine, looks very good... > > ... until the debugging session starts. At which point emacs decides > to create a new whole emacs app/window with the source code in it. It > boldly replaces the source window with the debugged app's output window > and throws the source into a new emacs instance. > > But the source code was already displayed and a breakpoint was set in > it showing that it is active and linked to gdb. Why do that ? If you > really want to show the output window, why not split the gdb window ? > Or maybe totally forget about the output window until the user wants > it ? "M-x gdb" works with dedicated windows, my suggestion is not to fight it wrt windows. If you want to display your own windows, do so in another frame. Alternatively, after "M-x gdb" type "start ARGUMENTS" to start the program and stop it at the entry to the main function. Then set your breakpoints after switching to the source file you want in the window where Emacs shows the file with the main function. 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. HTH