[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extend gdb to filter registers

From: Yuan Fu
Subject: Re: Extend gdb to filter registers
Date: Tue, 08 Oct 2019 23:44:40 -0400

> "which" => "whose"


> Is this expected to be set by the user via `setq`?
> If so, maybe it should be a `defcustom`?

Yeah, I made new variables customizable.

> If gdb-display-these-registers is t this will not "add" but remove all
> but `register` from the display, which might surprise the user.
> Along the same lines, if gdb-display-these-registers is a function this
> will either silently throw away the function (if `listp` returns nil) or
> build a "broken" list (if `listp` return non-nil, which is very much
> possible).
> ...
> This may similarly misbehave if gdb-display-these-registers is
> a function represented as a list (tho most likely in that case
> `register` won't be found in the list, so it will just silently do
> nothing).

I think I’ve found a good solution, please see the new patch. I replaced
function with regexp, which is easier to use and should suffice 99% use
cases since all we filtering here are just a few dozen registers.

Quoting the commit message:

Add filtering feature to register buffer of gdb-mi.
User can add or remove registers they want to see.

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.



Attachment: 0001-Add-register-filters-to-gdb-mi.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]