From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer Date: Sat, 01 Feb 2020 09:58:39 +0200 Message-ID: <83d0aykac0.fsf@gnu.org> References: <7ADCB299-819A-4D1F-A95A-03655C997E57@gmail.com> <83o8ukkkza.fsf@gnu.org> <30AFA53A-2A18-4E6A-A215-F0DEF4FB6B12@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="28737"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39179@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 01 09:00:23 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ixnhW-0007Om-LQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Feb 2020 09:00:22 +0100 Original-Received: from localhost ([::1]:36694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixnhV-0001lb-Ky for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Feb 2020 03:00:21 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38650) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ixnhD-0001lO-TO for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 03:00:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ixnhC-00050I-OA for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 03:00:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60576) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ixnhC-0004zh-Kk for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 03:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ixnhC-0004XR-HX for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2020 03:00:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Feb 2020 08:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39179 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 39179-submit@debbugs.gnu.org id=B39179.158054394417353 (code B ref 39179); Sat, 01 Feb 2020 08:00:02 +0000 Original-Received: (at 39179) by debbugs.gnu.org; 1 Feb 2020 07:59:04 +0000 Original-Received: from localhost ([127.0.0.1]:38316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ixngG-0004Vp-1i for submit@debbugs.gnu.org; Sat, 01 Feb 2020 02:59:04 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57584) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ixngE-0004VM-Pv for 39179@debbugs.gnu.org; Sat, 01 Feb 2020 02:59:03 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:34714) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ixng9-0003iD-IX; Sat, 01 Feb 2020 02:58:57 -0500 Original-Received: from [176.228.60.248] (port=2454 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ixng8-0005sq-3r; Sat, 01 Feb 2020 02:58:57 -0500 In-reply-to: <30AFA53A-2A18-4E6A-A215-F0DEF4FB6B12@gmail.com> (message from Yuan Fu on Fri, 31 Jan 2020 18:08:18 -0500) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:175547 Archived-At: > From: Yuan Fu > Date: Fri, 31 Jan 2020 18:08:18 -0500 > Cc: 39179@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?