VS Code-plugin for fpDebug
This plugin enables debugging Free Pascal applications with fpDebug.
It is essentially a wrapper around FPDServer, the debugging-server from fpDebug. This plugin includes an embedded version of FPDServer for 64-bits Windows and Linux.
FPDebug only suports x86 and x64 platfoms, running Windows or Linux.
It only works with Dwarf debug-information. So you have to compile your applications with the '-gw3' option.
If you are on a 32-bits system or macOS you have to compile FPDServer yourself. You can get it from here.
Press ctrl-p (cmd+p on OS X) and run
Press ctrl-shift-D to switch to the Run-screen. When there are no debuggers already defined, you have to select 'create a launch.json file'. Select 'Pascal (fpDebug)'. When there already is a launch.json file, you have to click on 'Add configuration' and select 'fpDebug: Launch program'.
Change the value of 'program' so that it points to the executable you want to debug. And maybe you want to change 'name' to something you can remember.
Set the configuration you just made as the active one, and press F5 to start debugging.
Use parameters, setup the environment and select a working-directory
To pass parameters to the program you want to debug, you have to add those to the debug-configuration (launch.json). The parameters are passed as an array of string.
The working-directory can be set in a similar way using a 'workingdirectory' element.
It is possible to set environment-variables by adding them as name-value combinations to 'environment'.
This is an example on how to set the environment, use program-parameters and to specify a working-directory:
Select another FPDServer-executable
It is possible to use another FPDServer-executable then the one embedded within this plugin. Just adapt the launch.json and add an fpdserver-section as follows:
Run FPDServer as a standalone server
It is also possible to start an instance of FPDServer and connect to it using tcp/ip. This way it is possible to do remote-debugging, or to debug the FPDServer itself. For this to work the plugin has to be configured to run in the 'connect' mode, and the port and hostname have to be provided in the launch.json.
It is possible to log all the DAB-communication between VS Code and the FPDServer. With the 'log' setting in launch.json set to 'true', a new output-window named 'FpDebug DAB communication' will appear.
This project is not finished yet. These are a few things that do not work as desired. (Patches are always welcome)
Questions, ideas and patches are welcome. You can send them directly to firstname.lastname@example.org, or discuss them at the fpc-pascal mailinglist.
This package is just a basic wrapper around FPDServer and will follow the version-number of the FPDServer it embeds. For the versions available, see the tags on this repository.
This extension consists of two parts, with each their own license: