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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39179 in the body.
You can then email your comments to 39179 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Sat, 18 Jan 2020 20:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yuan Fu <casouri <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 18 Jan 2020 20:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Bug Report Emacs <bug-gnu-emacs <at> gnu.org>
Subject: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Sat, 18 Jan 2020 15:51:31 -0500
[Message part 1 (text/plain, inline)]
By default the register buffer of gdb-mi displays all the registers. This patch allows a user to choose what to display: by enabling a filter. More information is included in the commit message.

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

In GNU Emacs 27.0.50 (build 3, x86_64-apple-darwin19.0.0, NS appkit-1894.10 Version 10.15.1 (Build 19B88))
of 2019-11-30 built on missSilver
Repository revision: e2828795d73637577c7726965974a047fe2d7119
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1894
System Description:  Mac OS X 10.15.2

Recent messages:
Mark set
Quit
Auto-saving...
Mark set
Quit
Delete unmerged branch master? (y or n) y
Quit [3 times]
Revert buffer from file /Users/yuan/emacs/lisp/progmodes/gdb-mi.el? (y or n) y
Showing all blocks ... done
Mark set

Configured using:
'configure --with-modules --with-pdumper=yes
--oldincludedir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/'

Configured features:
NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES
THREADS PDUMPER LCMS2

Important settings:
  value of $LC_CTYPE: UTF-8
  value of $LANG: en_CN.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  magit-todos-mode: t
  bug-reference-prog-mode: t
  desktop-save-mode: t
  ghelp-global-minor-mode: t
  minibuffer-electric-default-mode: t
  flymake-mode: t
  global-magit-file-mode: t
  magit-file-mode: t
  global-git-commit-mode: t
  async-bytecomp-package-mode: t
  shell-dirtrack-mode: t
  flyspell-mode: t
  outshine-mode: t
  ws-butler-global-mode: t
  ws-butler-mode: t
  minions-mode: t
  eyebrowse-mode: t
  savehist-mode: t
  global-hl-todo-mode: t
  hl-todo-mode: t
  global-highlight-parentheses-mode: t
  highlight-parentheses-mode: t
  rainbow-delimiters-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  electric-pair-mode: t
  winner-mode: t
  aggressive-indent-mode: t
  ivy-prescient-mode: t
  prescient-persist-mode: t
  recentf-mode: t
  which-key-mode: t
  general-override-mode: t
  outline-minor-mode: t
  ivy-mode: t
  company-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-quote-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  transient-mark-mode: t
  hs-minor-mode: t

Load-path shadows:
/Users/yuan/.emacs.d/ranch/winman/windman hides /Users/yuan/.emacs.d/ranch/windman/windman
/Users/yuan/.emacs.d/ranch/nerd-font/test/test-helper hides /Users/yuan/.emacs.d/ranch/doom-themes/test/test-helper
/Users/yuan/.emacs.d/ranch/julia-mode/julia-mode hides /Users/yuan/.emacs.d/package/julia-mode-20190813.1326/julia-mode
/Users/yuan/.emacs.d/ranch/julia-mode/julia-latexsubs hides /Users/yuan/.emacs.d/package/julia-mode-20190813.1326/julia-latexsubs
/Users/yuan/.emacs.d/ranch/matlab-emacs/mlint hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/mlint
/Users/yuan/.emacs.d/ranch/matlab-emacs/company-matlab-shell hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/company-matlab-shell
/Users/yuan/.emacs.d/ranch/matlab-emacs/linemark hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/linemark
/Users/yuan/.emacs.d/ranch/matlab-emacs/semanticdb-matlab hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/semanticdb-matlab
/Users/yuan/.emacs.d/ranch/matlab-emacs/semantic-matlab hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/semantic-matlab
/Users/yuan/.emacs.d/ranch/matlab-emacs/srecode-matlab hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/srecode-matlab
/Users/yuan/.emacs.d/ranch/matlab-emacs/matlab hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/matlab
/Users/yuan/.emacs.d/ranch/matlab-emacs/cedet-matlab hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/cedet-matlab
/Users/yuan/.emacs.d/ranch/matlab-emacs/tlc hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/tlc
/Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-publish hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/matlab-publish
/Users/yuan/.emacs.d/ranch/matlab-emacs/matlab-mode-pkg hides /Users/yuan/.emacs.d/package/matlab-mode-20180928.1526/matlab-mode-pkg
/Users/yuan/.emacs.d/package/faceup-20170925.1946/faceup hides /Users/yuan/attic/emacs/lisp/emacs-lisp/faceup

Features:
(magit-todos pcre2el rxt re-builder grep checkdoc lisp-mnt bug-reference
vc-mtn vc-hg ffap tramp tramp-loaddefs trampver tramp-integration
files-x tramp-compat parse-time iso8601 ls-lisp shadow sort mail-extr
emacsbug sendmail vc-git vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc
vc-dispatcher magit-bookmark bookmark company-oddmuse company-keywords
company-etags etags fileloop company-gtags company-dabbrev-code
company-dabbrev company-files company-capf company-cmake company-xcode
company-clang company-semantic company-eclim company-template
company-bbdb hideshow desktop frameset trivial-copy ghelp-eglot
ghelp-helpful ghelp-builtin ghelp cus-edit cus-start cus-load
luna-publish utility pause luna-general-config minibuf-eldef eglot array
jsonrpc ert pp ewoc debug flymake-proc flymake warnings url-util
magit-submodule magit-obsolete magit-blame magit-stash magit-reflog
magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote
magit-commit magit-sequence magit-notes magit-worktree magit-tag
magit-merge magit-branch magit-reset magit-files magit-refs magit-status
magit magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff-mode magit-core magit-autorevert autorevert filenotify
magit-margin magit-transient magit-process magit-mode transient
git-commit magit-git magit-section magit-utils crm log-edit message rmc
puny rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr
mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log with-editor
async-bytecomp async shell server flyspell ispell outshine
outshine-org-cmds outorg isolate inline expand-region
text-mode-expansions the-org-mode-expansions er-basic-expansions
thingatpt expand-region-core expand-region-custom ws-butler minions
eyebrowse savehist buffer-move windmove hl-todo highlight-parentheses
rainbow-delimiters doom-cyberpunk-theme undo-tree diff
doom-one-light-theme elec-pair winner doom-themes doom-themes-base
windman aggressive-indent find-char ivy-prescient prescient recentf-ext
recentf tree-widget wid-edit which-key general helpful imenu trace
edebug backtrace info-look f dash-functional help-fns radix-tree
elisp-refs s loop dash org-element avl-tree generator org advice
org-macro org-footnote org-pcomplete pcomplete org-list org-faces
org-entities time-date noutline outline org-version ob-emacs-lisp ob
ob-tangle org-src ob-ref ob-lob ob-table ob-keys ob-exp ob-comint
ob-core ob-eval org-compat org-macs org-loaddefs format-spec find-func
cal-menu calendar cal-loaddefs counsel xdg xref project dired
dired-loaddefs compile comint ansi-color swiper cl-extra help-mode ivy
delsel ring colir color ivy-overlay company edmacro kmacro pcase
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core finder-inf
tex-site info cowboy package easymenu browse-url url-handlers url-parse
auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs
password-cache json subr-x map url-vars cl-loaddefs cl-lib lunary
lunary-ui luna-f rx seq byte-opt gv bytecomp byte-compile cconv tooltip
eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 198126 23690)
(symbols 48 9373 50)
(strings 32 38317 1952)
(string-bytes 1 1116054)
(vectors 16 24583)
(vector-slots 8 288178 27922)
(floats 8 506 310)
(intervals 56 14663 1329)
(buffers 1000 26))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Fri, 31 Jan 2020 09:57:02 GMT) Full text and rfc822 format available.

Message #8 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Fri, 31 Jan 2020 11:56:25 +0200
> 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?

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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Fri, 31 Jan 2020 23:09:01 GMT) Full text and rfc822 format available.

Message #11 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39179 <at> debbugs.gnu.org
Subject: Re: 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)]



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Sat, 01 Feb 2020 02:23:02 GMT) Full text and rfc822 format available.

Message #14 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Fri, 31 Jan 2020 21:22:31 -0500
[Message part 1 (text/plain, inline)]
Sorry, I forgot to fix the white spaces after period in the commit message. Here is the correct one.

Yuan


[register-fixed.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Sat, 01 Feb 2020 08:00:02 GMT) Full text and rfc822 format available.

Message #17 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Sat, 01 Feb 2020 09:58:39 +0200
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Fri, 31 Jan 2020 18:08:18 -0500
> Cc: 39179 <at> debbugs.gnu.org
> 
> > 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).

I understand, but why wouldn't a simple defcustom do this job?  A list
of registers to display is a simple thing, no?

> And that depends on the program you are working on.

Really?  In what way?  I could only understand why you'd like to see
FP registers in some programs, but not in others.  But other than
that, why would you want to see this or that register?  Are you
frequently debugging on the machine language level?

> 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).

Then perhaps we should allow reordering the registers instead of
filtering their list, so that registers you want to see are at the
beginning?

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

Why don't you think a defcustom will do?

> +(defcustom gdb-registers-enable-filter nil
> +  "If t, enable register name filter in register buffer."
> +  :local t
> +  :type 'boolean
> +  :group 'gdb-buffers
> +  :version "27.1")

This should be "28.1", not "27.1".

> +(defcustom gdb-registers-filter-pattern-list nil
> +  "Registers that are displayed in register buffer.
> +
> +Should be a list.  Registers whose name can match
> +any of the regexps in the list is displayed."
                                  ^^
"are"

> +  :local t
> +  :type 'list
> +  :group 'gdb-buffers
> +  :version "28.1")
> +
>  (defvar gdb-debug-log nil
>    "List of commands sent to and replies received from GDB.
>  Most recent commands are listed first.  This list stores only the last
> @@ -4238,6 +4256,53 @@ gdb-frame-locals-buffer
>   'gdb-registers-mode
>   'gdb-invalidate-registers)
>  
> +(defun gdb-header-click-event-handler (function)
> +  "Return a function that handles clicking event on gdb header buttons.

This doesn't really return a function, it calls it, right?

But before we discuss the particular code, let's please first agree on
the design, OK?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Sun, 02 Feb 2020 14:33:01 GMT) Full text and rfc822 format available.

Message #20 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Sun, 2 Feb 2020 09:32:45 -0500

> On Feb 1, 2020, at 2:58 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
>> From: Yuan Fu <casouri <at> gmail.com>
>> Date: Fri, 31 Jan 2020 18:08:18 -0500
>> Cc: 39179 <at> debbugs.gnu.org
>> 
>>> 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).
> 
> I understand, but why wouldn't a simple defcustom do this job?  A list
> of registers to display is a simple thing, no?

My main concern is that defcustom wouldn’t be as convenient as the current one. Right now I only need `f + .*dx` and I’m good to go, whereas defcustom I need to go to customize and configure there, and come back.


>> And that depends on the program you are working on.
> 
> Really?  In what way?  I could only understand why you'd like to see
> FP registers in some programs, but not in others.  But other than
> that, why would you want to see this or that register?  Are you
> frequently debugging on the machine language level?

Honestly I only used this for the bomb lab in my CS course last semester where we need to debug assembly code. So if you think in real life scenarios we don’t really need this _quick_ filtering and customize will cut it. I’m fine with that too. Is your main reason of objection the (unnecessary) complexity of the code?

>> 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).
> 
> Then perhaps we should allow reordering the registers instead of
> filtering their list, so that registers you want to see are at the
> beginning?

That would be more complex that just filtering IMO. 

> 
>> So this feather is a session-based quick filtering for interesting registers, I don’t think defcustom makes it better.
> 
> Why don't you think a defcustom will do?

In the “quick” aspect (as I described above).

> 
>> +(defcustom gdb-registers-enable-filter nil
>> +  "If t, enable register name filter in register buffer."
>> +  :local t
>> +  :type 'boolean
>> +  :group 'gdb-buffers
>> +  :version "27.1")
> 
> This should be "28.1", not "27.1".
> 
>> +(defcustom gdb-registers-filter-pattern-list nil
>> +  "Registers that are displayed in register buffer.
>> +
>> +Should be a list.  Registers whose name can match
>> +any of the regexps in the list is displayed."
>                                  ^^
> "are"
> 
>> +  :local t
>> +  :type 'list
>> +  :group 'gdb-buffers
>> +  :version "28.1")
>> +
>> (defvar gdb-debug-log nil
>>   "List of commands sent to and replies received from GDB.
>> Most recent commands are listed first.  This list stores only the last
>> @@ -4238,6 +4256,53 @@ gdb-frame-locals-buffer
>>  'gdb-registers-mode
>>  'gdb-invalidate-registers)
>> 
>> +(defun gdb-header-click-event-handler (function)
>> +  "Return a function that handles clicking event on gdb header buttons.
> 
> This doesn't really return a function, it calls it, right?
> 
> But before we discuss the particular code, let's please first agree on
> the design, OK?

That’s ideal.

Thanks,
Yuan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Sun, 02 Feb 2020 15:53:02 GMT) Full text and rfc822 format available.

Message #23 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Sun, 02 Feb 2020 17:52:31 +0200
> From: Yuan Fu <casouri <at> gmail.com>
> Date: Sun, 2 Feb 2020 09:32:45 -0500
> Cc: 39179 <at> debbugs.gnu.org
> 
> >> 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).
> > 
> > I understand, but why wouldn't a simple defcustom do this job?  A list
> > of registers to display is a simple thing, no?
> 
> My main concern is that defcustom wouldn’t be as convenient as the current one. Right now I only need `f + .*dx` and I’m good to go, whereas defcustom I need to go to customize and configure there, and come back.

Sure, but this convenience is only a significant consideration for a
feature that is supposed to be used very frequently.  I don't think
this is so in this case.

> > Really?  In what way?  I could only understand why you'd like to see
> > FP registers in some programs, but not in others.  But other than
> > that, why would you want to see this or that register?  Are you
> > frequently debugging on the machine language level?
> 
> Honestly I only used this for the bomb lab in my CS course last semester where we need to debug assembly code. So if you think in real life scenarios we don’t really need this _quick_ filtering and customize will cut it. I’m fine with that too.

Good, then let's do it via a defcustom.

> Is your main reason of objection the (unnecessary) complexity of the code?

No, my main reason is to avoid unnecessarily cluttering the UI.

> > Then perhaps we should allow reordering the registers instead of
> > filtering their list, so that registers you want to see are at the
> > beginning?
> 
> That would be more complex that just filtering IMO. 

OK.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Sun, 09 Aug 2020 11:59:02 GMT) Full text and rfc822 format available.

Message #26 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Yuan Fu <casouri <at> gmail.com>, 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Sun, 09 Aug 2020 13:57:51 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:

>> Honestly I only used this for the bomb lab in my CS course last
>> semester where we need to debug assembly code. So if you think in
>> real life scenarios we don’t really need this _quick_ filtering and
>> customize will cut it. I’m fine with that too.
>
> Good, then let's do it via a defcustom.

Yuan, this was in February.  Did you find time to redo the patch using a
defcustom instead?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Mon, 10 Aug 2020 18:21:02 GMT) Full text and rfc822 format available.

Message #29 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Mon, 10 Aug 2020 14:20:06 -0400

> On Aug 9, 2020, at 7:57 AM, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
>>> Honestly I only used this for the bomb lab in my CS course last
>>> semester where we need to debug assembly code. So if you think in
>>> real life scenarios we don’t really need this _quick_ filtering and
>>> customize will cut it. I’m fine with that too.
>> 
>> Good, then let's do it via a defcustom.
> 
> Yuan, this was in February.  Did you find time to redo the patch using a
> defcustom instead?

Ah, I forgot about this, thanks. I promise I’ll do it :-)

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Wed, 12 May 2021 15:55:02 GMT) Full text and rfc822 format available.

Message #32 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Wed, 12 May 2021 17:54:20 +0200
Yuan Fu <casouri <at> gmail.com> writes:

> Ah, I forgot about this, thanks. I promise I’ll do it :-)

This was half a year ago.  :-)  Has there been any progress here?
Skimming this thread, it seems like the general consensus was that this
was a good feature to add...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Wed, 19 May 2021 00:20:02 GMT) Full text and rfc822 format available.

Message #35 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Tue, 18 May 2021 20:19:25 -0400
> On May 12, 2021, at 11:54 AM, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> 
> Yuan Fu <casouri <at> gmail.com> writes:
> 
>> Ah, I forgot about this, thanks. I promise I’ll do it :-)
> 
> This was half a year ago.  :-)  Has there been any progress here?
> Skimming this thread, it seems like the general consensus was that this
> was a good feature to add...
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>   bloggy blog: http://lars.ingebrigtsen.no

Hey Lars,

Thanks for reminding me, and sorry for the delay. I have rebased the patch and modified it, that wasn’t hard. But I had some problem installing a linux to test the patch on it, since gdb couldn’t work on my Mac. It shouldn’t take much longer though.

Yuan



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Thu, 22 Jul 2021 12:44:02 GMT) Full text and rfc822 format available.

Message #38 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Thu, 22 Jul 2021 14:43:23 +0200
Yuan Fu <casouri <at> gmail.com> writes:

> Thanks for reminding me, and sorry for the delay. I have rebased the
> patch and modified it, that wasn’t hard. But I had some problem
> installing a linux to test the patch on it, since gdb couldn’t work on
> my Mac. It shouldn’t take much longer though.

This was a couple of months ago -- have you made any further progress
here?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Sat, 24 Jul 2021 17:05:02 GMT) Full text and rfc822 format available.

Message #41 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Sat, 24 Jul 2021 13:04:41 -0400
[Message part 1 (text/plain, inline)]

> On Jul 22, 2021, at 8:43 AM, Lars Ingebrigtsen <larsi <at> gnus.org> wrote:
> 
> Yuan Fu <casouri <at> gmail.com> writes:
> 
>> Thanks for reminding me, and sorry for the delay. I have rebased the
>> patch and modified it, that wasn’t hard. But I had some problem
>> installing a linux to test the patch on it, since gdb couldn’t work on
>> my Mac. It shouldn’t take much longer though.
> 
> This was a couple of months ago -- have you made any further progress
> here?
> 

The 10th 10% isn’t it ;-) Here is the patch. I finally installed a linux VM and compiled Emacs on it and tested the patch. 

Yuan

[filter.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39179; Package emacs. (Sat, 24 Jul 2021 17:12:02 GMT) Full text and rfc822 format available.

Message #44 received at 39179 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Yuan Fu <casouri <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 39179 <at> debbugs.gnu.org
Subject: Re: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer
Date: Sat, 24 Jul 2021 19:11:39 +0200
Yuan Fu <casouri <at> gmail.com> writes:

> The 10th 10% isn’t it ;-) Here is the patch. I finally installed a
> linux VM and compiled Emacs on it and tested the patch.

Great; pushed to Emacs 28 now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 28.1, send any further explanations to 39179 <at> debbugs.gnu.org and Yuan Fu <casouri <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 24 Jul 2021 17:12:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 22 Aug 2021 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 238 days ago.

Previous Next


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