Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Gaius Mulley <gaius@glam.ac.uk>
To: "Pierre Muller" <muller@ics.u-strasbg.fr>
Cc: <gdb-patches@sources.redhat.com>
Subject: Re: [PATCH] Unbounded array support implemented (for Modula-2)
Date: Fri, 27 Jul 2007 13:17:00 -0000	[thread overview]
Message-ID: <87ejiu6nru.fsf@j228-gm.comp.glam.ac.uk> (raw)
In-Reply-To: <002a01c7cf57$b881b0c0$29851240$@u-strasbg.fr> (Pierre Muller's 	message of "Thu, 26 Jul 2007 09:36:46 +0200")


Hi Pierre,

"Pierre Muller" <muller@ics.u-strasbg.fr> writes:

>   Could you explain why you need to add 
> TSIZE as a synonym of SIZE?
>   Is it just a matter of parser shift/reduce conflicts?
>   Is TSIZE a modula-2 function?

yes a Modula-2 function in PIM-2 it was later replaced by SIZE
in PIM-4.  But GNU Modula-2 supports, PIM-[234] and users might
expect TSIZE to exist in the debugger.

>   Is your change in gdb.texinfo in a modula-2 specific
> area?

yes - in the Modula-2 example session.

> Modula-2 is not the only language supporting unbounded arrays, I
> would be interested in using the same kind of code for pascal
> language support.

sure, I'm all for refactoring code..

>   Maybe a more general approach would be useful?

maybe - although I suspect the devil is in the detail.  Basically
Modula-2 assumes that all unbounded arrays start at index 0 and the
caller can be legally access all indices 0..HIGH(a).  GNU Modula-2
implements unbounded arrays by creating a structure whose first field
is a pointer to type, and the second structure is the HIGH value
(unsigned int).  So the patches basically detect if the array
declaration matches a GNU Modula-2 unbounded structure (testing field
names and types and language).  If so then it maps any reference to
a[i] onto a->_m2_contents[i] and HIGH(a) onto a->_m2_high.  How does
GNU Pascal implement unbounded arrays?

>  One more remark: in m2_unbounded_array function, it would probably
> be better to honor the value of the show argument, and to only
> output something if show is non-zero.

many thanks for the spotting this - it is now implemented this in the
latest patch.

regards,
Gaius


  reply	other threads:[~2007-07-27 12:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26  7:07 Gaius Mulley
2007-07-26  7:36 ` Markus Deuling
2007-07-27 12:26   ` Gaius Mulley
2007-07-27 20:22     ` Eli Zaretskii
2007-07-30  8:29       ` Gaius Mulley
2007-07-30 23:34         ` Jim Blandy
2007-07-31  3:01         ` Jim Blandy
2007-07-31 16:47           ` Gaius Mulley
2007-07-31 16:48             ` Jim Blandy
2007-08-01 14:01               ` Gaius Mulley
2007-07-31 19:18             ` Jim Blandy
2007-10-16 16:59               ` Gaius Mulley
2007-10-16 22:04                 ` Jim Blandy
2007-07-26 22:58 ` Pierre Muller
2007-07-27 13:17   ` Gaius Mulley [this message]
2007-07-27 13:28     ` Pierre Muller
2007-07-28  0:59   ` Jim Blandy
2007-07-30  6:29     ` Gaius Mulley

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=87ejiu6nru.fsf@j228-gm.comp.glam.ac.uk \
    --to=gaius@glam.ac.uk \
    --cc=gdb-patches@sources.redhat.com \
    --cc=muller@ics.u-strasbg.fr \
    /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