First of all, you must be sure that the compiler is compiled with debugging support. Unfortunately, there is no way to check this at run time, except by trying to compile a program with debugging support.
To compile a program with debugging support, just specify the -g option on the command-line, as follows:
fpc -g hello.pp |
Note that the above will only generate debug information for the code that has been generated when compiling hello.pp. This means that if you used some units (the system unit, for instance) which were not compiled with debugging support, no debugging support will be available for the code in these units.
There are 2 solutions for this problem.
The second option may have undesirable side effects. It may be that some units aren’t found, or compile incorrectly due to missing conditionals, etc..
If all went well, the executable now contains the necessary information with which you can debug it using GNU gdb.