public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <sourceware-bugzilla@sourceware.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	[thread overview]
Message-ID: <bug-26372-4717-LFCTLkXeIa@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-26372-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=26372

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=3945d2d77e373c828ebbbb05b3ba06adf39019ab

author  Gaius Mulley <gaiusmod2@gmail.com>      
        Tue, 25 Aug 2020 08:39:27 +0000 (09:39 +0100)
committer       Andrew Burgess <andrew.burgess@embecosm.com>    
        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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2020-08-25 10:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 10:55 [Bug m2/26372] New: " vries at gcc dot gnu.org
2020-08-25  9:17 ` [Bug m2/26372] " cvs-commit at gcc dot gnu.org
2020-08-25  9:32 ` cvs-commit at gcc dot gnu.org
2020-08-25 10:01 ` vries at gcc dot gnu.org [this message]
2020-08-25 10:02 ` vries at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-26372-4717-LFCTLkXeIa@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).