[fpc-pascal] Arrays in debugger; No range errors on arrays
Lance Boyle
lanceboyle at cwazy.co.uk
Wed May 25 01:14:45 CEST 2005
On May 24, 2005, at 5:31 AM, Jonas Maebe wrote:
>
> On 24 mei 2005, at 13:58, Lance Boyle wrote:
>
>> As I've indicated in some of the comments, there appears to be some
>> 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? What other
surprises should I know about before using FPC?
Side comment--It's partly the Pascal-dialect problem that is driving me
to do most of my new programming in Ada (Ada = no dialects). For the
interested:
(Mac users: go to www.macada.org for GNAT, a free, gcc-based,
absolutely stunning Ada compiler that works with 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).
>
>> A second issue is that arrays that begin with any index other than 0
>> seem to be displayed incorrectly in the debugger window of Xcode.
>
> 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^) ?
>
>
> Jonas
>
More information about the fpc-pascal
mailing list