unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Konstantin Kharlamov <hi-angel@yandex.ru>
To: Michael Welsh Duggan <mwd@md5i.com>, emacs-devel@gnu.org
Subject: Re: Difficulty using M-x gdb
Date: Sat, 04 Feb 2023 00:35:11 +0300	[thread overview]
Message-ID: <d77e29a7e34e75ba496c7777be272b7acc6ab66a.camel@yandex.ru> (raw)
In-Reply-To: <87357pqvxq.fsf@md5i.com>

On Wed, 2023-02-01 at 09:53 -0500, Michael Welsh Duggan wrote:
> I have used "M-x gud-gdb" to run gdb for many years.  I used it for
> quite a while after the gdb-mi interface was added due to its ability to
> debug the same program multiple times at the same time in the same
> Emacs.  I don't need that capability right now. 
> 
> Due to a bug in `gud-gdb` (#61162) I am trying to switch to "M-x gdb"
> instead.  Unfortunately, I can't really figure out how to make this work
> in a way that makes sense to me.  `gdb-many-windows` being nil is the
> default, and the default should be reasonably easy to use (one would
> hope), but I am having the following problem:
> 
> When I step through a program, the interface keeps track of where I am
> in the source buffer.  But, when the program produces output, it
> replaces the source buffer window with an input/output buffer window
> which is dedicated.  The only way I have found out to display the source
> buffer again is to use "M-x gdb-restore-windows".  In code that is doing
> a fair amount of output, this is very tedious.
> 
> What is right way to handle this?  If it requires customization, why is
> customization needed to make this fairly common case work well?  Is
> there a way to make output go the interaction buffer?  Maybe most
> importantly, this input/output buffer/window doesn't seem to be
> mentioned in the Emacs documentation at all.
> 
> I have my suspicions that, once I get used to the new interface, I might
> like using it, but right now I'm having difficulty figuring out what
> habits I need to relearn.

FWIW, I have the following code in my config that fixes the behavior you
mention.

    ;; Force gdb-mi to not dedicate any windows
    (advice-add 'gdb-display-buffer
            :around (lambda (orig-fun &rest r)
                  (let ((window (apply orig-fun r)))
                (set-window-dedicated-p window nil)
                window)))

With that said, neither I think it's a useful default behavior to replace a
window with a source code file with the one that shows app output.



      parent reply	other threads:[~2023-02-03 21:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01 14:53 Difficulty using M-x gdb Michael Welsh Duggan
2023-02-01 17:07 ` Eli Zaretskii
2023-02-01 23:18   ` Yuan Fu
2023-02-01 23:53     ` Dmitry Gutov
2023-02-02  0:18       ` Dmitry Gutov
2023-02-02 18:50   ` Eli Zaretskii
2023-02-05 15:26     ` Madhu
2023-02-05 15:33       ` Eli Zaretskii
2023-02-06 23:23         ` Madhu
2023-02-03 21:35 ` Konstantin Kharlamov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d77e29a7e34e75ba496c7777be272b7acc6ab66a.camel@yandex.ru \
    --to=hi-angel@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=mwd@md5i.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).