From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 877AA3857C6F; Tue, 25 Aug 2020 10:01:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 877AA3857C6F From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug m2/26372] [Modula-2] Parsing of multi-subscript arrays broken Date: Tue, 25 Aug 2020 10:01:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: m2 X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Aug 2020 10:01:43 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26372 Tom de Vries changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #3 from Tom de Vries --- https://sourceware.org/git/?p=3Dbinutils-gdb.git;a=3Dcommit;h=3D3945d2d77e3= 73c828ebbbb05b3ba06adf39019ab author Gaius Mulley =20=20=20=20=20=20 Tue, 25 Aug 2020 08:39:27 +0000 (09:39 +0100) committer Andrew Burgess =20=20=20=20 Tue, 25 Aug 2020 09:28:06 +0000 (10:28 +0100) commit 3945d2d77e373c828ebbbb05b3ba06adf39019ab gdb/modula-2: parsing of multi-subscript arrays Fix bug PR m2/26372, GDB's inability to parse multi-dimensional modula-2 arrays. We previously had two rules for handling the parsing of array sub-scripts. I have reproduced them here with the actual handler blocks removed to make the bug clearer: exp : exp '[' non_empty_arglist ']' ; exp : exp '[' exp ']' ; non_empty_arglist : exp ; non_empty_arglist : non_empty_arglist ',' exp ; This is ambiguous as the pattern "exp '[' exp" could match either of the 'exp' rules. Currently it just so happens that the parser picks the second 'exp' rule which means we can only handle a single array index. As the handler code for the first 'exp' pattern will correctly handle and number of array indexes then lets just remove the second pattern. gdb/ChangeLog: PR m2/26372 * m2-exp.y (exp): Improve comment for non_empty_arglist case, add an assert. Remove single element array indexing pattern as the MULTI_SUBSCRIPT support will handle this case too. gdb/testsuite/ChangeLog: PR m2/26372 * gdb.modula2/multidim.c: New file. * gdb.modula2/multidim.exp: New file. --=20 You are receiving this mail because: You are on the CC list for the bug.=