From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oVfbGL1im2q1zCoAWB0awg (envelope-from ) for ; Fri, 04 Sep 2026 20:30:53 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dZ1PF6wn; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5DBF71E166; Fri, 04 Sep 2026 20:30:53 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9F92F1E033 for ; Fri, 04 Sep 2026 20:30:52 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5E8564BB3BB2 for ; Sat, 5 Sep 2026 00:30:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E8564BB3BB2 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dZ1PF6wn Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 944ED4BB58CC for ; Sat, 5 Sep 2026 00:30:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 944ED4BB58CC Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 944ED4BB58CC Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788568225; cv=none; b=O6av9hEmkFLnQD5saKHLNcTKTYFYDg1hbxLVCKf53bB4pODUKk722LkX2VXd/kAtxmWLVjRqlvO5Ua19xpxaNMiOEK90ROFk6DL2adl7zqinJaAPfL6j1get3gvgEtVEiE+BDk7k6xQ0mEDLGr8/2orbGhkpP5MJIddXjZUVIew= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1788568225; c=relaxed/simple; bh=EKrMPSmamS4B/JKiDoUBuKJxR1hPgeIs871o+am6XyU=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=dydMR8D6ZBhHwzlcfUb2RDxWjWK2QagtCNLVHvxqbs9fV5X4sf+TLelxwY5/sqXcMAeWceAkUNAmOvxXOo4mkbbLbhdsYtDOWPvASHYyDdCz5VJVpVcn2bdkPHx0jwGqsaO7oJbi2D5++3SVzgZPAjigrk1/KCjohLJiNE0D7z0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dZ1PF6wn DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 944ED4BB58CC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1788568225; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RbX2N1cb9plfh6f1o0GoMH7Kg+XfpnLT54zY0tDEy80=; b=dZ1PF6wnXkswiRTtAaksGhOtLvgaSGw8pwJktT+GQBMdcv1XKfS5G1o77Afcs7UCu8Ybm7 oydJjM5P9T5V3TH8dW/nM8F/ObZgFdhxQ5Ad2RjXkntlscN3XL6TKJ+06d9wfwA6aiHQKy Sc3s6s4UgBAYtuQFpGqD8tZQSFdIvBI= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-637-aB5es0BaNWqJmblvNb0pdA-1; Fri, 04 Sep 2026 20:30:22 -0400 X-MC-Unique: aB5es0BaNWqJmblvNb0pdA-1 X-Mimecast-MFC-AGG-ID: aB5es0BaNWqJmblvNb0pdA_1788568221 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 7061B18F0F14; Sat, 5 Sep 2026 00:30:21 +0000 (UTC) Received: from f44-mesa-1 (unknown [10.22.64.36]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9BE321955F0D; Sat, 5 Sep 2026 00:30:20 +0000 (UTC) Date: Fri, 4 Sep 2026 17:30:18 -0700 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: simon.marchi@polymtl.ca Subject: Re: [PATCH 16/17] gdb: move m2-exp-parser.y's support code to m2-exp-parser.c Message-ID: <20260904173018.489d28a8@f44-mesa-1> In-Reply-To: <20260904170338.1643894-17-simon.marchi@polymtl.ca> References: <20260904170338.1643894-1-simon.marchi@polymtl.ca> <20260904170338.1643894-17-simon.marchi@polymtl.ca> Organization: Red Hat MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: todVwdou48H5c-aPoXpHmTHbRWiarmNt6rkz9Gqlb94_1788568221 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On Fri, 4 Sep 2026 12:56:48 -0400 simon.marchi@polymtl.ca wrote: > From: Simon Marchi > > Similar to the previous commits, but for the Modula-2 expression parser. > > Like the Fortran parser, the Modula-2 parser is entered through the > m2_language::parser method rather than a free function, so add a free > function m2_parse as the entry point (like the other parsers) and turn > m2_language::parser into a thin wrapper around it, defined in m2-lang.c. > > Put the parser support code inside the m2_exp_parser namespace. > > Change-Id: I92669a1af7fb81cf59bfb41e2b8c63ce323652d2 > --- > gdb/Makefile.in | 2 + > gdb/m2-exp-parser.c | 488 ++++++++++++++++++++++++++++++++++++++++++++ > gdb/m2-exp-parser.h | 67 ++++++ > gdb/m2-exp-parser.y | 465 +---------------------------------------- > gdb/m2-lang.c | 9 + > 5 files changed, 568 insertions(+), 463 deletions(-) > create mode 100644 gdb/m2-exp-parser.c > create mode 100644 gdb/m2-exp-parser.h > > diff --git a/gdb/Makefile.in b/gdb/Makefile.in > index 4289c5151fd0..1c4ba5a12d57 100644 > --- a/gdb/Makefile.in > +++ b/gdb/Makefile.in > @@ -1137,6 +1137,7 @@ COMMON_SFILES = \ > language.c \ > linespec.c \ > location.c \ > + m2-exp-parser.c \ > m2-lang.c \ > m2-typeprint.c \ > m2-valprint.c \ > @@ -1518,6 +1519,7 @@ HFILES_NO_SRCDIR = \ > linux-tdep.h \ > location.h \ > loongarch-tdep.h \ > + m2-exp-parser.h \ > m2-exp.h \ > m2-lang.h \ > m32r-tdep.h \ > diff --git a/gdb/m2-exp-parser.c b/gdb/m2-exp-parser.c > new file mode 100644 > index 000000000000..821f1507aef3 > --- /dev/null > +++ b/gdb/m2-exp-parser.c > @@ -0,0 +1,488 @@ > +/* YACC parser support code for Modula-2 expressions, for GDB. > + > + Copyright (C) 1986-2026 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see . */ > + > +#include "m2-exp-parser.h" > +#include "m2-exp-parser-gen.h" > +#include "block.h" > +#include "expression.h" > +#include "language.h" > +#include "m2-exp.h" > +#include "parser-defs.h" > +#include "value.h" > + > +/* The entry point of the bison/yacc-generated parser, defined in > + m2-exp-parser-gen.c. Bison produces a declaration for m2_yyparse in > + m2-exp-parser-gen.h, but byacc does not, hence this declaration. */ > + > +int m2_yyparse (); > + > +/* Likewise, byacc does not produce a declaration for m2_yydebug. */ > + > +extern int m2_yydebug; Another nit found by the AI patch reviewer; it notes that the extern for m2_yydebug is never used. But it also noted that this was pre-existing behavior. Kevin