To debug your programs, (a) GNU Pascal must be able to generate executables with debug info for your platform, and (b) you must have a debugger which understands this.
gpc: -g not supported for this platform
then GPC is unable to generate debugging info. Usually, installing gas (part of GNU binutils) instead of your system's assembler can overcome this. When you configure the GCC used for GPC, specify --with-gnu-as, and possibly --with-gnu-ld and/or --with-stabs. More information can be found in the INSTALL file in the GNU CC source directory.
The bottom line: if you can debug GCC compiled programs, you should be able to do this with GPC too.
The GNU debugger (gdb) currently does not have a “Pascal” mode, so it is unable to display certain Pascal structures etc. When debugging, please note that the Initial Letter In Each Identifier Is In Upper Case And The Rest Are In Lower Case. If you want to display variable foo in the debugger, type show Foo or display Foo instead.
Although gdb is an excellent debugger, it's user interface is
not everybody's preference. If you like to debug under X11, please
refer to the comp.windows.x FAQ:
“Where can I get an X-based debugger?” at:
Some useful frontends include: XXGDB, tGDB and XWPE. See:
Very nice, but resource consuming is the Motif based DDD:
Furthermore, RHIDE (see IDE) contains built-in debugging suport, similar to the IDE of BP.