GNU bug report logs - #39179
27.0.50; [PATCH] Add filter to gdb-mi register buffer

Previous Next

Package: emacs;

Reported by: Yuan Fu <casouri <at> gmail.com>

Date: Sat, 18 Jan 2020 20:52:02 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39179 <at> debbugs.gnu.org
Subject: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Fri, 31 Jan 2020 18:08:18 -0500
[Message part 1 (text/plain, inline)]

> On Jan 31, 2020, at 4:56 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Yuan Fu <casouri <at> gmail.com>
>> Date: Sat, 18 Jan 2020 15:51:31 -0500
>> 
>> On startup, there will be a button “[filter off]” on the header line
>> of the register buffer. Clicking on it enables the register filter,
>> changes the button to “[filter on]” and adds a “[-|+]” button next to
>> it. Click “+” to add patterns to the pattern list, click “-” to
>> remove. Register whose name matches any pattern in the list is
>> displayed. You can also use key “f” for toggle, “+” to add pattern,
>> “-” to remove pattern.
> 
> I'm not sure it's a good idea to implement this as a button on the
> header-line.  Such buttons are for frequent operations, and also have
> the disadvantage of being unavailable on TTY frames.  What are the
> chances users will need to redefine the register patters frequently
> enough to justify the button?  Wouldn't it be much easier to have a
> defcustom whose value users could interactively modify as needed?

I mainly use it to display only the registers I care about, say, all the *dx registers (rdx, edx, dx) or all the r** registers (rdx, rsi, etc). And that depends on the program you are working on. The main motivation behind this patch is that, currently the register buffer simply displays all the possible registers (153 on my machine), and tracking on some of them is very hard (scrolling back and forth, very annoying).

So this feather is a session-based quick filtering for interesting registers, I don’t think defcustom makes it better.

As for the buttons, I mimicked the buttons on memory buffer. And you don’r really need to use these buttons, instead of clicking this buttons, I just hit -/+/f key (since register buffer is a special buffer) and it’s convenient:

>> You can also use key “f” for toggle, “+” to add pattern,
>> “-” to remove pattern.


---------------------------------

> And please don't use non-ASCII characters in log messages, as these
> could cause trouble reading the Git log on less capable terminals.
> 
>> * lisp/progmodes/gdb-mi.el (gdb-registers-enable-filter,
>> gdb-registers-filter-pattern-list, gdb-header-click-event-handler,
>> gdb-registers-add-to-display, gdb-registers-remove-from-display,
>> gdb-registers-toggle-filter): new
>                                ^^^
> "New functions."
> 
>> (gdb-registers-handler-custom): condition check before adding each
>> register
>> (gdb-registers-mode-map): add new keys
>> (gdb-registers-header): add new buttons
> 
> Please start description of changes with a capitalized word, and end
> with a period -- these should be complete English sentences.
> 
>> +;; automatically local because we don't want filters persist across gdb sessions
> 
> Likewise in comments: complete sentences (here and elsewhere in the
> patch).
> 
> Thanks.

I’ve fixed these bits, here is the revised patch.

Yuan

[register-fixed.patch (application/octet-stream, attachment)]
[Message part 3 (text/plain, inline)]



This bug report was last modified 4 years and 20 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.