This document provides instructions and hints for how to build and develop this extension. More information on contributions to this project can be found in the contribution guidelines.
We use yarn to as our package manager. To build, simply do
yarn
yarn build
You can also run the build in watch mode using
yarn watch
If you are working on the cdt-gdb-adapter you can check it out to a different location and then link it in.
From the cdt-gdb-adapter project run
yarn link
Then from this project run
yarn link cdt-gdb-adapter
You can set up a VS Code workspace that has both folders. Also make sure you have builds running in each folder to pick up updates (e.g. yarn watch
).
The way to debug cdt-gdb-adapter works with the same principle as the example Mock Debug Adapter provided by VS Code. For detailed instructions please refer to Development Setup for Mock Debug.
The short step-by-step version is:
- Launch this extension with the
Extension
launch configuration (cdt-gdb-vscode's launch.json) - Launch cdt-gdb-adapter in server mode with either
Server
orServer (Target adapter)
depending on whether you want to use local debugging or target debugging, corresponding to"type": "gdb"
and"type": "gdbtarget"
respectively. (cdt-gdb-adapter's launch.json) - Add a breakpoint somewhere useful, such as
launchRequest
- Add
"debugServer": 4711
to the launch configuration in the extension development host. The4711
is the port number that cdt-gdb-adapter is listening on. - Debug the C/C++ program in the extension development host.