[fpc-pascal] Arrays in debugger; No range errors on arrays

Marco van de Voort marcov at stack.nl
Wed May 25 08:31:26 CEST 2005

> On May 24, 2005, at 5:31 AM, Jonas Maebe wrote:
> >> range checking issues--is range checking off by default?
> >
> > Yes, it is. Add {$r+} at the top of your source to turn it on, or add 
> > "-Cr" to the command line options of the compiler.
> Thanks, Jonas.
> Well--that's just lovely. How about getting this fixed?

It's by design, since normal for Borland + compatibles. 

> What other surprises should I know about before using FPC?

That depends on your mindset. I don't know enough about Ada, but since GNAT
is a gcc derivate, expect better compile speed with FPC :-)
> (All: go to http://www.cs.nyu.edu/cs/faculty/schonber/gnat.html)
> (To convert Pascal to Ada: Google p2ada)
> (For a complete THINK Pascal library emulation in Ada, go to 
> http://www.chez.com/blady/creations.html#ada_thp).

More interesting would be the other way around.
> > That's a problem of gdb not properly supporting Pascal arrays, which 
> > indeed can start at an index <> 0. There is a set of patches to create 
> > gdbpas, which may have this fixed, but I haven't built it for Mac OS X 
> > yet (also, you'd probably have to overwrite the system's gdb with this 
> > gdbpas for XCode to use it).
> I wonder if I would be able to specify gdbpas only when using FPC and 
> the regular gdb otherwise? (And the Ada-patched gdb for Ada 8^) ?

Well, maybe all non mainstream GDB users should gang up and try to get more
GDB support accepted. (I assume Ada can make arrays start at non zero too?)

However this is a significant amount of work. Pierre did this for a while,
which really bumped GDB usability with FPC.

More information about the fpc-pascal mailing list