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

Lance Boyle lanceboyle at cwazy.co.uk
Wed May 25 08:50:37 CEST 2005


On May 24, 2005, at 11:31 PM, Marco van de Voort wrote:

>> 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.

Well, OK--at least there is a reason.

>
>> 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 :-)

True. But I still haven't played with the background compiling and 
smart linking in Xcode.

>
>> (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?)

That's correct.
>
> 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