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: Fri, 6 Oct 2023 14:09:01 +0200 Message-ID: References: <83wmw12fu5.fsf@gnu.org> <83jzs12cdv.fsf@gnu.org> <83il7k3nru.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\)) Content-Type: multipart/mixed; boundary="Apple-Mail=_4D169025-340A-4341-A87C-9A8959271FA7" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14127"; 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 Fri Oct 06 14:10:23 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 1qojex-0003Tw-MI for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 06 Oct 2023 14:10:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qojej-0008Ee-F0; Fri, 06 Oct 2023 08:10:09 -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 1qojeP-0007vU-UH for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2023 08:09:53 -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 1qojeK-0000Mg-2i for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2023 08:09:45 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qojec-0007n1-Gt for bug-gnu-emacs@gnu.org; Fri, 06 Oct 2023 08:10: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: Fri, 06 Oct 2023 12:10: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.169659417129897 (code B ref 66363); Fri, 06 Oct 2023 12:10:02 +0000 Original-Received: (at 66363) by debbugs.gnu.org; 6 Oct 2023 12:09:31 +0000 Original-Received: from localhost ([127.0.0.1]:49352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoje7-0007m8-52 for submit@debbugs.gnu.org; Fri, 06 Oct 2023 08:09:31 -0400 Original-Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]:55747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qoje3-0007lu-Ui for 66363@debbugs.gnu.org; Fri, 06 Oct 2023 08:09:29 -0400 Original-Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-50573e85ee0so2497010e87.3 for <66363@debbugs.gnu.org>; Fri, 06 Oct 2023 05:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696594143; x=1697198943; darn=debbugs.gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:from:to:cc:subject:date:message-id:reply-to; bh=NAqh8UBsGtLjoVmcP9s2jV+HS4QKi50bZlSx4w9NXQI=; b=JfaaUjxXdmlOQ4qJU2aYXd12+eaFJIbxlj30uPyKGbf/YHVR04PDodFHGU3YLyGy41 piBLmqJFanaIKlzL5nmZNIaN0sGQ6+UrH4HIzcGX7cM8FjdXtaDBlgXNBAHC8LBqIp7A gE8n4PjNk19esPPfp9+Jqh0kW1LexXFBUqS2cQEXOyDXSkAR1rUgfu7UMUlOBZpQn1V+ tJdvhMTOM0lCde1ebl8J0OrIstCwbHclQXKAxReSfGA4KIFEmzDrpr1lApxCvG/6fVeZ PYyXG8+NjMu3LUUD/QjLBqSZtOou3OmD6geIOCwW2z4GQAyFfa4asQ+wn2hQ+zaOSRjw KayQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696594143; x=1697198943; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NAqh8UBsGtLjoVmcP9s2jV+HS4QKi50bZlSx4w9NXQI=; b=N7+n/tVYoq5E2Ft8NlTObu4hseSiQUg4364VGsApH707/PAGJhQamoVqJFJuKdD/o2 9b6WxxK8DZLjKQmEK1R6/bIzfkK3UJtF+kqvqwIYK5ciEE/08i03llKzg5MPno4dgduI bZZG7bPsuA1gP60Ze2P0ErjwfZwSEWFGiagS+ZlS6v82xrk3PWtUp6FGmHXZwNSpo+EX 5IwMcCwHSsmITwzZaANkqVHj+ifHDHKOX219wrETAjt8Tmb9IUe8PQdDuQdY1nbpIeGo 1OKkMwwlOw99a2wKEbbf9f0Y1rCuyLLBNwsSq9hL5f4Nn8TAY1BUcpbKLHlU7SCOMJNP Q7cg== X-Gm-Message-State: AOJu0YxxOFNY0kvvU9BndudhNpxXij+lbN+JZfVRt0Wq+EJ5N1DIeVVF mPmWl8Jz0ZYaaWj/s1+KGgE= X-Google-Smtp-Source: AGHT+IE1uW0TZCW0JnN1Ek7ZTxG4QS+bfcyua2EjLlLPgx4XZonQtgdhwF5TWH0jqp4frr9uD+ZMYQ== X-Received: by 2002:a19:e05d:0:b0:503:3804:d2ce with SMTP id g29-20020a19e05d000000b005033804d2cemr6757298lfj.35.1696594142724; Fri, 06 Oct 2023 05:09:02 -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 q9-20020a19a409000000b00501b9fc977csm280159lfc.37.2023.10.06.05.09.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2023 05:09:02 -0700 (PDT) In-Reply-To: <83il7k3nru.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:271940 Archived-At: --Apple-Mail=_4D169025-340A-4341-A87C-9A8959271FA7 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii 5 okt. 2023 kl. 20.52 skrev Eli Zaretskii : > I'm okay with the changes in principle, but someone will have > to test them by running all of the control commands and verifying they > work after the fix, before this can be installed. I myself won't have > the time for doing that any time soon, sorry. That's fine, I can wait. The bug only affects GDB users so I'm not = personally inconvenienced. Here's an improved version of the patch that also fixes another bug in = the original code: the extra match against = gdb-python-guile-commands-regexp is both incorrect (not anchored) and = superfluous as that information is available in the match just made. For instance, consider what happens if the command string is "stepping = ...". It will match gdb-control-command-regexp and also = gdb-python-guile-commands-regexp and set python-or-guile-p, despite not = being a Python or Guile command, and prevent gdb-control-level from = being incremented. --Apple-Mail=_4D169025-340A-4341-A87C-9A8959271FA7 Content-Disposition: attachment; filename=gdb-control-commands-regexp-2.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="gdb-control-commands-regexp-2.diff" Content-Transfer-Encoding: quoted-printable diff=20--git=20a/lisp/progmodes/gdb-mi.el=20b/lisp/progmodes/gdb-mi.el=0A= index=20bc0070d2630..3afdc59a67e=20100644=0A---=20= a/lisp/progmodes/gdb-mi.el=0A+++=20b/lisp/progmodes/gdb-mi.el=0A@@=20= -1960,19=20+1960,23=20@@=20breakpoint-disabled=0A=20=20=20:group=20'gdb)=0A= =20=0A=20=0C=0A-(defvar=20gdb-python-guile-commands-regexp=0A-=20=20= "python\\|python-interactive\\|pi\\|guile\\|guile-repl\\|gr"=0A-=20=20= "Regexp=20that=20matches=20Python=20and=20Guile=20commands=20supported=20= by=20GDB.")=0A-=0A=20(defvar=20gdb-control-commands-regexp=0A-=20=20= (concat=0A-=20=20=20"^\\("=0A-=20=20=20= "comm\\(a\\(n\\(ds?\\)?\\)?\\)?\\|if\\|while"=0A-=20=20=20= "\\|def\\(i\\(ne?\\)?\\)?\\|doc\\(u\\(m\\(e\\(nt?\\)?\\)?\\)?\\)?\\|"=0A= -=20=20=20gdb-python-guile-commands-regexp=0A-=20=20=20= "\\|while-stepping\\|stepp\\(i\\(ng?\\)?\\)?\\|ws\\|actions"=0A-=20=20=20= "\\|expl\\(o\\(re?\\)?\\)?"=0A-=20=20=20= "\\)\\([[:blank:]]+\\([^[:blank:]]*\\)\\)*$")=0A+=20=20(rx=20bol=0A+=20=20= =20=20=20=20(or=0A+=20=20=20=20=20=20=20(or=20"comm"=20"comma"=20= "comman"=20"command"=20"commands"=0A+=20=20=20=20=20=20=20=20=20=20=20= "if"=20"while"=0A+=20=20=20=20=20=20=20=20=20=20=20"def"=20"defi"=20= "defin"=20"define"=0A+=20=20=20=20=20=20=20=20=20=20=20"doc"=20"docu"=20= "docum"=20"docume"=20"documen"=20"document"=0A+=20=20=20=20=20=20=20=20=20= =20=20"while-stepping"=0A+=20=20=20=20=20=20=20=20=20=20=20"stepp"=20= "steppi"=20"steppin"=20"stepping"=0A+=20=20=20=20=20=20=20=20=20=20=20= "ws"=20"actions"=0A+=20=20=20=20=20=20=20=20=20=20=20"expl"=20"explo"=20= "explor"=20"explore")=0A+=20=20=20=20=20=20=20(group=20=20=20=20=20=20=20= =20=20;=20group=201:=20Python=20and=20Guile=20commands=0A+=20=20=20=20=20= =20=20=20(or=20"python"=20"python-interactive"=20"pi"=20"guile"=20= "guile-repl"=20"gr")))=0A+=20=20=20=20=20=20(?=20(+=20blank)=0A+=20=20=20= =20=20=20=20=20=20(group=20=20=20=20=20=20=20;=20group=202:=20command=20= arguments=0A+=20=20=20=20=20=20=20=20=20=20(*=20nonl)))=0A+=20=20=20=20=20= =20eol)=0A=20=20=20"Regexp=20matching=20GDB=20commands=20that=20enter=20= a=20recursive=20reading=20loop.=0A=20As=20long=20as=20GDB=20is=20in=20= the=20recursive=20reading=20loop,=20it=20does=20not=20expect=0A=20= commands=20to=20be=20prefixed=20by=20\"-interpreter-exec=20console\".")=0A= @@=20-2032,15=20+2036,13=20@@=20gdb-send=0A=20=20=20=20=20=20=20(setq=20= gdb-continuation=20nil)))=0A=20=20=20;;=20Python=20and=20Guile=20= commands=20that=20have=20an=20argument=20don't=20enter=20the=0A=20=20=20= ;;=20recursive=20reading=20loop.=0A-=20=20(let*=20((control-command-p=20= (string-match=20gdb-control-commands-regexp=20string))=0A-=20=20=20=20=20= =20=20=20=20(command-arg=20(and=20control-command-p=20(match-string=203=20= string)))=0A-=20=20=20=20=20=20=20=20=20(python-or-guile-p=20= (string-match=20gdb-python-guile-commands-regexp=0A-=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20string)))=0A-=20=20=20=20(if=20(and=20= control-command-p=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20(or=20(not=20= python-or-guile-p)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (null=20command-arg)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= (zerop=20(length=20command-arg))))=0A-=20=20=20=20=20=20=20=20(setq=20= gdb-control-level=20(1+=20gdb-control-level)))))=0A+=20=20(when=20= (string-match=20gdb-control-commands-regexp=20string)=0A+=20=20=20=20= (let=20((python-or-guile-p=20(match-beginning=201))=0A+=20=20=20=20=20=20= =20=20=20=20(command-arg=20(match-string=202=20string)))=0A+=20=20=20=20=20= =20(when=20(or=20(not=20python-or-guile-p)=0A+=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20(null=20command-arg)=0A+=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20(zerop=20(length=20command-arg)))=0A+=20=20=20=20=20=20= =20=20(setq=20gdb-control-level=20(1+=20gdb-control-level))))))=0A=20=0A=20= (defun=20gdb-mi-quote=20(string)=0A=20=20=20"Return=20STRING=20quoted=20= properly=20as=20an=20MI=20argument.=0A= --Apple-Mail=_4D169025-340A-4341-A87C-9A8959271FA7--