This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Unbounded array support implemented (for Modula-2)


Jim Blandy <jimb@codesourcery.com> writes:

> "Pierre Muller" <muller@ics.u-strasbg.fr> writes:
>>   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. 
>
> In C, there are ABI documents that specify how each type is
> represented in memory for a given processor, the goal being to specify
> things enough that one can link code from different vendor's compilers
> together when they implement the same ABI.  It sounds like the 'PIM'
> documents are the equivalent for Modula-2; is that right?

Hi Jim,

ah alas, the PIM (Programming in Modula-2 books by N. Wirth) ed2, ed3
and ed4 don't say how unbounded arrays should be implemented or
anything about parameter ordering etc - they really concentrate on the
semantics of the language itself and to a lesser extent the libraries.
The ISO standard doesn't say much about unbounded array implementation
either - although it does tidy up many other loose ends.


> Are there equivalent documents for Pascal?
>
> I'm not sure it actually would be a good idea to unify Pascal and
> Modula-2 code if they are meant to follow different specifications.
> Bugs in that common code might have the same fix for both languages,
> or they might not.  People would hesitate to fix things, for fear of
> breaking the other language they're not familiar with.
>
> I don't think we should require Gaius's patch to unify the
> Pascal/Modula-2 support.

I agree :-) the amount of shared code would be fairly small anyhow and
many blocks would have to be predicated by testing whether we were in
Modula-2 language mode or Pascal language mode.  At which point it
begs the question whether these sections of code would be better
separately placed into m2-valprint.c, p-valprint.c, m2-typeprint.c and
p-typeprint.c etc.

regards,
Gaius


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]