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 20:11:24 +0200 Message-ID: References: <83wmw12fu5.fsf@gnu.org> <83jzs12cdv.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="36021"; 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 20:11:55 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 1qoSpH-00098M-Oh for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Oct 2023 20:11:55 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoSp8-00064h-Pj; Thu, 05 Oct 2023 14:11:46 -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 1qoSp6-00064Q-Kp for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 14:11:44 -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 1qoSp6-0004BC-79 for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 14:11:44 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qoSpO-0008Ia-Eo for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2023 14:12: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 18:12: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.169652951331881 (code B ref 66363); Thu, 05 Oct 2023 18:12:02 +0000 Original-Received: (at 66363) by debbugs.gnu.org; 5 Oct 2023 18:11:53 +0000 Original-Received: from localhost ([127.0.0.1]:48500 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoSpF-0008I8-23 for submit@debbugs.gnu.org; Thu, 05 Oct 2023 14:11:53 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:54432) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoSpC-0008Hv-7s for 66363@debbugs.gnu.org; Thu, 05 Oct 2023 14:11:51 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-503f39d3236so1633103e87.0 for <66363@debbugs.gnu.org>; Thu, 05 Oct 2023 11:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696529486; x=1697134286; 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=2BxAN2o59CR8hCqZh+Cnr0FAVu0plOIO01ASTzvXL+M=; b=ZJAUZiP8s5y7Ahy7yypQ1jnLkpjSrD1l2Zm3OT6Ij0WYwwmkLyCKS6f/CFdBDx+Fr7 wASxBIgXc7P1xEuQ6qMqvAfVmgGnv1kWHxo4pjpQYiUGsXTy+H/ih3oRBjQaG2+ZKv7b HBRCay3r7Q/4hiQF9SzVTRxAgWKAVRU9XFooPsNqNAXGC75z4SZMYbRCXQMi05WtC7+D GcdlEOy15GHdUlIN3HGRp2ikZC1ZnYNmH2Y9kKL1/A01q54mZUyuP0b4JibFLGUBiqh8 f95ISOepH9TPEZBg7ieLkwCZPJUkDdEhAujtm4cjMNCAH1Qv7oA+zFwLW2/VZ4be6M99 WabQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696529486; x=1697134286; 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=2BxAN2o59CR8hCqZh+Cnr0FAVu0plOIO01ASTzvXL+M=; b=JLHgE37ae706kkP4+dSRQiqKYVD2ey8Xa3pbUutPksZgk9DTeqV6Tvcm1a+BuZJMRz XXgijmurz9IkKzhY+jH1ZBrM9/6WQ3wn02pp2zR/LIF9B+lpXfw8eljYuJT3jXYWE4PG k/Efg6u3jZ1M2zcKvkRlrk0aXFiLTsQrvTmBeGIs66UGHXFe4XSNIvdMWNuUabi0hyUn KM7FhYzZ9955tpXNIFdZgQ38z2eUnO2Mxpli5XrHX8u08u4l+sikeWBmS5lT9J0dvmWG MMvHGz7hfwi5NUehfXdG1+VVKMo1anDyUxugF7RyWmeInoFAGBz6U3P4m4+PkK++q+rK ZsUg== X-Gm-Message-State: AOJu0YzV/RBwzocXchL5KJUXYn1cBAENHhMGVpJFetIzeTv5691/HhL+ BjWEMHaAirj0diy1TrcFl2BmUS7oSxzkyw== X-Google-Smtp-Source: AGHT+IE4/Q849gXmUBYEJxT57sxxwRWQqeMIvjWvL/MWEktNwcRsqjkiSRn76pXMU8UP69TI0RKgDw== X-Received: by 2002:a05:6512:ba0:b0:502:9fce:b6d4 with SMTP id b32-20020a0565120ba000b005029fceb6d4mr6599848lfv.25.1696529485758; Thu, 05 Oct 2023 11:11:25 -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 q25-20020ac24a79000000b0050419b760d0sm389226lfp.17.2023.10.05.11.11.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Oct 2023 11:11:25 -0700 (PDT) In-Reply-To: <83jzs12cdv.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:271909 Archived-At: 5 okt. 2023 kl. 19.43 skrev Eli Zaretskii : > So the problem is only that 3 should be changed to the correct group > number? That would perhaps work, but it wouldn't be a very robust solution. = There are many groups preceding that we don't care about, and the bug = arose precisely because they were added without considering that a group = was being used. Better then to get rid of all groups save the one in use. (The proposed = patch does that.) That would make it much more difficult for the same bug to arise again. > Here you are talking about some optimization of the regexp, or is it > another bug? If the latter, what is the bug here? It's related. When the reference to subgroup 3 was added (30c0f81f9f), = the tail looked like this: "\\([[:blank:]]+\\([^[:blank:]]*\\)\\)?$" ^^^^^^^^^^^^^^^^^^^ and subgroup 3 was the second group in this substring (underlined = above). Later (f71afd600a) the last `?` was changed into a `*`, but that = made the contents of that group somewhat hazy because of the repetition: "\\([[:blank:]]+\\([^[:blank:]]*\\)\\)*$" ^ which doesn't leave us with a useful group for the purpose of detecting = command arguments at all. So the tail of the regexp has to be rewritten anyway, and we might as = well do it in a more straightforward way. (The proposed patch does that = as well.) The reason I found this is that it contains a sub-pattern on the form = (A+B*)* which is super-linear in general but usually easy to fix so that = the result is actually more readable, yet faster.