From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#39179: 27.0.50; [PATCH] Add filter to gdb-mi register buffer Date: Sun, 2 Feb 2020 09:32:45 -0500 Message-ID: <60CA7D7C-F6ED-4BEC-817A-35BCE7E120CB@gmail.com> References: <7ADCB299-819A-4D1F-A95A-03655C997E57@gmail.com> <83o8ukkkza.fsf@gnu.org> <30AFA53A-2A18-4E6A-A215-F0DEF4FB6B12@gmail.com> <83d0aykac0.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="83060"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 39179@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 02 15:33:13 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 1iyGJE-000LS2-BQ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Feb 2020 15:33:12 +0100 Original-Received: from localhost ([::1]:56804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyGJD-0003Dr-EI for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Feb 2020 09:33:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34005) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyGJ5-0003DZ-DQ for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 09:33:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyGJ4-000539-5M for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 09:33:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33719) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iyGJ4-000535-2V for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 09:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iyGJ3-00030s-VT for bug-gnu-emacs@gnu.org; Sun, 02 Feb 2020 09:33:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Feb 2020 14:33:01 +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.158065398111573 (code B ref 39179); Sun, 02 Feb 2020 14:33:01 +0000 Original-Received: (at 39179) by debbugs.gnu.org; 2 Feb 2020 14:33:01 +0000 Original-Received: from localhost ([127.0.0.1]:39692 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyGJ2-00030Z-P7 for submit@debbugs.gnu.org; Sun, 02 Feb 2020 09:33:01 -0500 Original-Received: from mail-qt1-f181.google.com ([209.85.160.181]:33660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iyGJ0-00030H-Kk for 39179@debbugs.gnu.org; Sun, 02 Feb 2020 09:32:59 -0500 Original-Received: by mail-qt1-f181.google.com with SMTP id d5so9455402qto.0 for <39179@debbugs.gnu.org>; Sun, 02 Feb 2020 06:32:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pZvp6fOVLqA0gnep3ZWxzuS4rBhx+yUgtQk2fRPl254=; b=BOESD1uKGPgAE7OM32zx8x7p/OItzuWlOxh2sb1iL8XJlMXzWN2Arq8Tla7MMaY3DU rWWmV17J/t+wvSkdDfjgMygtDzynO0PbC6Y1Abe0Tc2pcJrW7ZQl/8L6Ew2TAURNDlrQ vSMuRJZ2UFaYEAxj/YBB23oFVHZqbv1odkQxgoczEVY75s62e/Yai5dDmCjadJdewySK PYLC5/e9zSU4bT/OO/9MyxJUDBR49cnwxX7PnjanhXy1EThp/7mY+ivuXfBpKuEFBJcj tqpJKqn64JsED8q/TpkQTtQuJzLNCIo3pFB5uissvfbl6Deuy89m5M3BUUMo1nxqZnUn d5qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=pZvp6fOVLqA0gnep3ZWxzuS4rBhx+yUgtQk2fRPl254=; b=loZfXYt89utdMNE69zACX4z3AL3IE0nZXAj8MQu/pBJO90qa47sSzYVstA4oviWN3q oxEC4GJeeOYBCcmNFQ6vuGth0jxzhuQIP33mYmJyWK0b70hGxPkxktGBBcy36gDLURFO gl/+/dm7QIkQSE3IVAF1KmaKnOQcIjs01piqMj6UOUPgI7SwIpFCcjFV8IUyj6FYs76b x6dYpDVp/hdlnAAj/3uoKhY8I2og4Jmu91Twm7zKrbdR07rLVjF14s0l1XzhIU3SWdrp 6s3BengK50ehTKd2qfXzSnKKFx2aBCLuNuZm7kIeeu02p8qS848F1gM8VO55vgF3X7ed Mkfw== X-Gm-Message-State: APjAAAV+oGYpatELZn+fqW9r6TRWPU2CrFL4kBCAKjglHfI8EcEurilc oI3Tpp6NWAG9SJ+VErlyvlY= X-Google-Smtp-Source: APXvYqyPRHpRdh1qBdfjLgf1bz6RjFeVcI9rtxm9nvjR4Yi4y7qnxwibqun1rI5cYNJznEayr23QAQ== X-Received: by 2002:ac8:6650:: with SMTP id j16mr19649982qtp.294.1580653972984; Sun, 02 Feb 2020 06:32:52 -0800 (PST) Original-Received: from [192.168.1.5] (c-174-60-229-153.hsd1.pa.comcast.net. [174.60.229.153]) by smtp.gmail.com with ESMTPSA id q130sm7545413qka.114.2020.02.02.06.32.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Feb 2020 06:32:52 -0800 (PST) In-Reply-To: <83d0aykac0.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.40.2.2.4) 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:175590 Archived-At: > On Feb 1, 2020, at 2:58 AM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Fri, 31 Jan 2020 18:08:18 -0500 >> Cc: 39179@debbugs.gnu.org >>=20 >>> 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? >>=20 >> 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). >=20 > 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=E2=80=99t be as convenient as = the current one. Right now I only need `f + .*dx` and I=E2=80=99m 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. >=20 > 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=E2=80=99t really need this _quick_ filtering and = customize will cut it. I=E2=80=99m 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). >=20 > 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.=20 >=20 >> So this feather is a session-based quick filtering for interesting = registers, I don=E2=80=99t think defcustom makes it better. >=20 > Why don't you think a defcustom will do? In the =E2=80=9Cquick=E2=80=9D aspect (as I described above). >=20 >> +(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") >=20 > This should be "28.1", not "27.1". >=20 >> +(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" >=20 >> + :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) >>=20 >> +(defun gdb-header-click-event-handler (function) >> + "Return a function that handles clicking event on gdb header = buttons. >=20 > This doesn't really return a function, it calls it, right? >=20 > But before we discuss the particular code, let's please first agree on > the design, OK? That=E2=80=99s ideal. Thanks, Yuan