From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#66363: gdb-control-commands-regexp issues Date: Thu, 5 Oct 2023 19:16:32 +0200 Message-ID: References: <83wmw12fu5.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9400"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66363@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Oct 05 19:17:14 2023 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 1qoRyL-0002G1-Np for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Oct 2023 19:17:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoRxw-0008WI-1K; Thu, 05 Oct 2023 13:16:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoRxt-0008SC-2n for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 13:16:45 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoRxs-0005M9-8w for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 13:16:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoRyA-0006az-Hl for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 13:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Oct 2023 17:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66363 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66363-submit@debbugs.gnu.org id=B66363.169652622125330 (code B ref 66363); Thu, 05 Oct 2023 17:17:02 +0000 Original-Received: (at 66363) by debbugs.gnu.org; 5 Oct 2023 17:17:01 +0000 Original-Received: from localhost ([127.0.0.1]:48450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoRy8-0006aS-Kl for submit@debbugs.gnu.org; Thu, 05 Oct 2023 13:17:01 -0400 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:42384) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoRy7-0006aG-8J for 66363@debbugs.gnu.org; Thu, 05 Oct 2023 13:16:59 -0400 Original-Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c1807f3400so15577431fa.1 for <66363@debbugs.gnu.org>; Thu, 05 Oct 2023 10:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696526195; x=1697130995; darn=debbugs.gnu.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject :date:message-id:reply-to; bh=bYmK62RKzLwsfwoN/qVyd5ViqUEV6LofD1yJsS1RMQE=; b=Z125sbEYpu2Dds3C1VsS5XPA3I3OI96z7jPnYhoSBiBYw/c7mW+YXk8JxeG4RSrxAK UoVeY/9sOrKBe1Z9LsUh+LeNIgRhNsOCb8G/5Ah+RF0H/tAr03Bf/tTQz7E1AORegtlo 28uY2eAOxIUUcSdl0IiFiP/3yUz52Nby/XNds4h2hwYvktXu/Qo6HMv/4wSXFVrH4HvN hYw7LFIXENnRNC8kvT0eOFYw/6NQV9YjgW3loUf/zAS/hLmcak0ARasFBIBpb3DtC5Kr 32vPTzL5+H9J3J5epgYS8tMjW9OrjDBbMLh84Rl9H0l2CBN89VQZMCZkX7H3fUfJrAuL MIAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696526195; x=1697130995; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=bYmK62RKzLwsfwoN/qVyd5ViqUEV6LofD1yJsS1RMQE=; b=tn3AgwSANKYkfoBY92iGuGg5BxleBWf4nX0mqBRf0zXBiL9ebrGwToSh+SEULfcLzq UEMP62t0vAwBdKRfjvi0GSb+J9djIya/hXsFf4gXZdLdsEpBXE/WZoqDuWoDdY2LvNVc 4wFRP7AY7/8YX4mnfWfsic6k6ejaNfABy1ClY8L2TfgvS5vceI76ViE4yw33A18xhaN2 RG88xalTaz3iyJR7NxIhffofR2abhvN48+8p7vFc1ycYljUp1JThB3erKbwQ/dp/YPy7 jkQ+CjmFIT8WlBgKkULupWC9yiQ1ierd9+KlUxilLeQq1miIpaJLvrDs+WRk7iwcKkBs v4KA== X-Gm-Message-State: AOJu0YygaFnn6iOjaS2SivHE7ZWCBPRTHCdeOfCk1xkcRty5JVe+S+vU E8DPjcNi56anebCcHlS5onM= X-Google-Smtp-Source: AGHT+IEzLikH/rptHAHWrRZrh8pxM2Ck8hntBFfKlH1uoZuwlzs82k45MfK2Nic7yyk2/hYHoxyB3A== X-Received: by 2002:a2e:9347:0:b0:2c0:7d6:570b with SMTP id m7-20020a2e9347000000b002c007d6570bmr2314315ljh.26.1696526194650; Thu, 05 Oct 2023 10:16:34 -0700 (PDT) Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se. [188.150.165.235]) by smtp.gmail.com with ESMTPSA id w23-20020a2e8217000000b002b9f03729e2sm373906ljg.36.2023.10.05.10.16.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2023 10:16:33 -0700 (PDT) In-Reply-To: <83wmw12fu5.fsf@gnu.org> X-Mailer: Apple Mail (2.3654.120.0.1.15) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271905 Archived-At: > I'd appreciate a few examples of using this that don't work correctly > (or not at all), as it is otherwise not easy to understand the > problem, and much less the proposed solution and how to test it. I don't have any examples but the problems are clear from reading the = code. The regexp is defined by: > (defvar gdb-python-guile-commands-regexp > "python\\|python-interactive\\|pi\\|guile\\|guile-repl\\|gr" > "Regexp that matches Python and Guile commands supported by GDB.") >=20 > (defvar gdb-control-commands-regexp > (concat > "^\\(" > "comm\\(a\\(n\\(ds?\\)?\\)?\\)?\\|if\\|while" > = "\\|def\\(i\\(ne?\\)?\\)?\\|doc\\(u\\(m\\(e\\(nt?\\)?\\)?\\)?\\)?\\|" > gdb-python-guile-commands-regexp > "\\|while-stepping\\|stepp\\(i\\(ng?\\)?\\)?\\|ws\\|actions" > "\\|expl\\(o\\(re?\\)?\\)?" > "\\)\\([[:blank:]]+\\([^[:blank:]]*\\)\\)*$") > "Regexp matching GDB commands that enter a recursive reading loop. > As long as GDB is in the recursive reading loop, it does not expect > commands to be prefixed by \"-interpreter-exec console\".") which results in the string regexp > = "^\\(comm\\(a\\(n\\(ds?\\)?\\)?\\)?\\|if\\|while\\|def\\(i\\(ne?\\)?\\)?\\= |doc\\(u\\(m\\(e\\(nt?\\)?\\)?\\)?\\)?\\|python\\|python-interactive\\|pi\= \|guile\\|guile-repl\\|gr\\|while-stepping\\|stepp\\(i\\(ng?\\)?\\)?\\|ws\= \|actions\\|expl\\(o\\(re?\\)?\\)?\\)\\([[:blank:]]+\\([^[:blank:]]*\\)\\)= *$" It is used in one place only: > (let* ((control-command-p (string-match gdb-control-commands-regexp = string)) > (command-arg (and control-command-p (match-string 3 string))) As you can see it refers to group 3, which is matched by = "\\(n\\(ds?\\)?\\)" -- clearly not what anybody intended. As for the tail, even if the match group is corrected it's a rather = roundabout way of checking whether there is a non-blank character after = the command (and is written using nested repetitions which is how this = came to my attention). For the examples you asked about, perhaps commit 30c0f81f9f which = introduced the now broken mechanism can be of help.