unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: martin rudalics <rudalics@gmx.at>,
	emacs-devel <emacs-devel@gnu.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	John Yates <john@yates-sheets.org>, Juri Linkov <juri@linkov.net>
Subject: Re: Extend gdb to filter registers
Date: Fri, 24 Jan 2020 15:12:37 -0500	[thread overview]
Message-ID: <B4F54D46-AC59-4BCC-9061-FF433BBCE47F@gmail.com> (raw)
In-Reply-To: <83lfpxs4sl.fsf@gnu.org>

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



> On Jan 24, 2020, at 2:16 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> 
>> From: Yuan Fu <casouri@gmail.com>
>> Date: Tue, 21 Jan 2020 20:50:46 -0500
>> Cc: martin rudalics <rudalics@gmx.at>,
>> Juri Linkov <juri@linkov.net>,
>> emacs-devel@gnu.org,
>> monnier@iro.umontreal.ca,
>> john@yates-sheets.org
>> 
>> Here is my first attempt. I make every function that needs to display a source buffer (only 2: gdb-goto-breakpoint, gud-display-line) use gdb-display-source-buffer. Previously they either use (or gdb-display-source-buffer display-buffer) or use (display-buffer). 
> 
> Thanks.
> 
> I have two comments/questions to this design:
> 
>  . I think "M-x gud-gdb" should be unaffected by these changes.  That
>    command exists so that users who are unhappy with the new UI
>    presented in gdb-mi.el, or have use cases that are insufficiently
>    well supported by gdb-mi.el, so its workings must remain as they
>    were historically.  Does your patch affect only gdb-mi.el?

No, but this can be easily fixed. I’ll fix that in the next patch.

>  . Are we sure that all the places that now use
>    gdb-display-source-buffer should indeed use the same logic?  From
>    the names of the functions it seems the answer is YES, but could
>    there be use cases where this isn't so?

In gdb-mi.el, there is only one function that used gbd-display-source-buffer — gdb-goto-breakpoint. In gud.el, there is also only one function, gud-display-frame calls gud-display-line calls gdb-display-source-buffer (after patch, before patch it calls display-buffer). And gud-display-frame is used to display a file:line. Overall I think it’s save. Of course you can never be so sure by just looking at the code and reason. But there is no test, and I don’t know how to write tests for interactive programs like this. Maybe you can give me some pointers on tests, if you think that’s vitally important.

> I'm also slightly worried by the fact that previously this stuff
> obeyed the display-buffer customizations, whereas after these changes
> it won't.  Martin, any thoughts or comments?

I still haven’t had a clear idea on “how to open the new window” part. In the previous patch I simply used display-window-pop-window so the code works, but we should definitely come up with something else. Currently my naive idea is to use (display-buffer buffer gdb-display-source-buffer-action), where gdb-display-source-buffer-action can be customized by user. WDYT?

> 
>> I added a variable for maximum number of windows used for source buffer. Right now the simple logic is to open as much windows as possible until the max is reached, then we start to reuse windows. Creating new window uses display-buffer-pop-up-window (I use this function just for completeness, I would modify this part when adding customization, maybe let user customize action for display-buffer?)
> 
> I don't understand this part: wasn't the original motivation to cause
> gdb-mi to _always_ reuse the source window?

You have the choice. If I want gdb to always reuse the window, I can set the number to 1. 

> And in any case, I'm not sure a simple max number of windows is a
> reasonable criterion for this functionality.  E.g., if I needed to set
> the value of this variable, I wouldn't know what value to choose.

I guess you mean this is somewhat ad-hoc. I agree. We can change it to options like “always reuse one”, “switch between 2”, “cycle between 3” and “as many as possible”, how about that? I.e., 

(defcustom gdb-source-window-number 'always-reuse-one
  :type 'symbol
  :options '(always-reuse-one switch-between-two
                              cycle-between-three
                              as-many-as-possible)
  :group 'gdb
  "Number of source windows gdb uses.”)

> 
>> If you think this patch is fine, I’ll do these next: 1) add a straightforward customization, preferably only one variable. 2) currently gdb opens windows everywhere, I want to make it open in only one continues area and maybe balance windows. Do you think this is worth doing? Or it is suffice to let user customize the display-buffer action?
> 
> My personal preference, and something I was always telling users who
> expressed frustration with gdb-mi window handling, is to devote a
> separate frame to gdb-mi windows.  This avoids messing up the user's
> windows on other frames.  If enough people here agree with that,
> perhaps we should move gdb-mi towards preferring such a modus
> operandi?

Are you referring to the complain that gdb messes up windows after it quits? That’s not hard to fix since we have window-configurations now. I have a patch that makes gdb preserves window configuration that the user had prior to starting gdb. As for opening a new frame, that solves the problem in someway, but what if someone don’t want to open a new frame and don’t want gdb messes his windows either? If you are talking about the problem where gdb opens new source windows when I don’t want it to, I don’t see now opening gdb in a new frame help that.

Yuan


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

  reply	other threads:[~2020-01-24 20:12 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-03 16:40 Extend gdb to filter registers Yuan Fu
2019-10-04 16:13 ` Fu Yuan
2019-10-04 19:32   ` Eli Zaretskii
2019-10-04 19:49 ` Stefan Monnier
2019-10-04 21:55   ` Yuan Fu
2019-10-05  3:15     ` Yuan Fu
2019-10-05  7:08       ` Eli Zaretskii
2019-10-05 13:15         ` Yuan Fu
2019-10-05 13:53           ` Eli Zaretskii
2019-10-05 17:51             ` Yuan Fu
2019-10-05 19:01               ` Eli Zaretskii
2019-10-06  4:24                 ` Yuan Fu
2019-10-06 17:36                   ` Eli Zaretskii
2019-10-08  2:23                     ` Yuan Fu
2019-10-06  4:43               ` Michael Welsh Duggan
2019-10-07 15:50                 ` Yuan Fu
2019-10-07 16:19                   ` Michael Welsh Duggan
2019-10-08  0:19                     ` Yuan Fu
2019-10-08 17:26       ` Stefan Monnier
2019-10-09  3:44         ` Yuan Fu
2019-10-09  3:51           ` Yuan Fu
2019-10-15  3:05           ` Yuan Fu
2019-10-15  9:48             ` martin rudalics
2019-10-17  3:14               ` Yuan Fu
2019-10-17  3:27                 ` Yuan Fu
2019-10-17  8:26                 ` martin rudalics
2019-10-15 18:10             ` Juri Linkov
2019-10-15 20:51               ` Stefan Monnier
2019-10-17  3:08               ` Yuan Fu
2019-10-17  8:19                 ` Eli Zaretskii
2019-10-26 21:56                   ` Yuan Fu
2019-10-27  7:47                     ` martin rudalics
2019-10-27 17:38                       ` Yuan Fu
2020-01-16  4:25                         ` Yuan Fu
2020-01-16 14:51                           ` Eli Zaretskii
2020-01-16 15:04                             ` Yuan Fu
     [not found]                               ` <CAO0xp5w8PwAiy=JNVmCK652rCs_06cMAO5_+1ppHwppQ2js4VQ@mail.gmail.com>
2020-01-17 23:31                                 ` Yuan Fu
2020-01-18 11:15                               ` Eli Zaretskii
2020-01-18 13:32                                 ` Yuan Fu
2020-01-18 15:21                                   ` Eli Zaretskii
2020-01-18 15:41                                     ` Yuan Fu
2020-01-18 16:50                                       ` Eli Zaretskii
2020-01-18 16:20                                 ` John Yates
2020-01-18 16:53                                   ` Eli Zaretskii
2020-01-18 17:53                                     ` Yuan Fu
2020-01-18 17:56                                       ` Eli Zaretskii
2020-01-18 18:21                                     ` martin rudalics
2020-01-18 18:33                                       ` Eli Zaretskii
2020-01-18 18:36                                         ` Yuan Fu
2020-01-18 18:48                                           ` Eli Zaretskii
2020-01-18 20:10                                             ` Yuan Fu
2020-01-18 18:41                                         ` martin rudalics
2020-01-18 19:18                                           ` Eli Zaretskii
2020-01-18 21:43                                             ` martin rudalics
2020-01-19 15:40                                               ` Eli Zaretskii
2020-01-19 17:33                                                 ` Yuan Fu
2020-01-19 17:42                                                   ` Eli Zaretskii
2020-01-19 17:57                                                     ` Yuan Fu
2020-01-19 18:43                                                       ` Eli Zaretskii
2020-01-19 19:35                                                         ` Yuan Fu
2020-01-19 20:07                                                           ` Eli Zaretskii
2020-01-20  1:22                                                             ` Yuan Fu
2020-01-20 18:03                                                               ` Eli Zaretskii
2020-01-22  1:50                                                                 ` Yuan Fu
2020-01-24  7:16                                                                   ` Eli Zaretskii
2020-01-24 20:12                                                                     ` Yuan Fu [this message]
2020-01-24 22:37                                                                       ` John Yates
2020-01-25  7:45                                                                         ` Eli Zaretskii
2020-01-25 14:33                                                                           ` John Yates
2020-01-25 17:10                                                                             ` Eli Zaretskii
2020-01-25  8:43                                                                         ` martin rudalics
2020-01-25 14:56                                                                           ` John Yates
2020-01-25 17:14                                                                             ` martin rudalics
2020-01-25 20:17                                                                               ` John Yates
2020-01-26  8:41                                                                                 ` martin rudalics
2020-01-26  4:18                                                                         ` Richard Stallman
2020-01-26  5:09                                                                           ` Drew Adams
2020-01-26  5:31                                                                             ` Yuan Fu
2020-01-26 17:12                                                                           ` Eli Zaretskii
2020-01-25  8:24                                                                       ` Eli Zaretskii
2020-01-25  8:58                                                                         ` martin rudalics
2020-01-25 10:25                                                                           ` Eli Zaretskii
2020-01-25 10:30                                                                             ` Eli Zaretskii
2020-01-25 22:34                                                                         ` Yuan Fu
2020-01-26  8:42                                                                           ` martin rudalics
2020-01-26 16:12                                                                             ` Yuan Fu
2020-01-26 16:57                                                                               ` martin rudalics
2020-01-27 15:56                                                                                 ` Yuan Fu
2020-01-27 19:18                                                                                   ` martin rudalics
2020-01-27 19:53                                                                                     ` Yuan Fu
2020-01-28  9:49                                                                                       ` martin rudalics
2020-01-28 20:01                                                                                         ` Yuan Fu
2020-01-28 20:33                                                                                           ` John Yates
2020-01-31 13:58                                                                           ` Eli Zaretskii
2020-01-31 15:25                                                                             ` Yuan Fu
2020-01-31 15:35                                                                               ` Eli Zaretskii
2020-01-25  8:43                                                                       ` martin rudalics
2020-01-25 10:21                                                                         ` Eli Zaretskii
2020-01-25 12:11                                                                           ` martin rudalics
2020-01-25 13:35                                                                             ` Eli Zaretskii
2020-01-25  8:42                                                                     ` martin rudalics
2020-01-19 18:30                                                   ` martin rudalics
2020-01-19 18:47                                                     ` Eli Zaretskii
2020-01-19 18:05                                                 ` martin rudalics

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=B4F54D46-AC59-4BCC-9061-FF433BBCE47F@gmail.com \
    --to=casouri@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=john@yates-sheets.org \
    --cc=juri@linkov.net \
    --cc=monnier@iro.umontreal.ca \
    --cc=rudalics@gmx.at \
    /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).