__________________ SourcePawn Debug Adapter and Server for VSCode
An extension for Visual Studio Code that adds support debugging in SourcePawn vm.
- Step Into.
- Step Over.
- Step Out.
- Show local/global variables.
- Show callstack.
- Support multiple sessions.
- Download last sm-debugger from github releases:https://github.com/Garey27/sm-debugger/releases
- Unpack the contents of the archive on the destination game server.
- Open VSCode, install the extension. VSCode marketplace
- Open the project in VSCode, configure the sourcepawn Debugger configuration by clicking on the appropriate button in the "Run and Debug" section.
- Connect to the server by pressing the F5 button.
Extension both on the game server and in VSCode, allow you to change the port for communication with each other. This can be useful if you are debugging several projects at once on different game servers, but on the same host. To do this, in /addons/sourcemod/configs/core.cfg, you can add the DebuggerPort parameter, which will indicate which port the debug server should use (by default, port 12345 is occupied).
It is also possible to set a delay between the start of the debug server and the continuation of the work of SRCDS itself (it can be useful if you need to debug OnPluginStart () exactly when the server starts). To do this, in the same file, specify the DebuggerDelay variable with the value you need (float).
Note that the extension currently "listens" for connections from all network interfaces, and does not have any authorization to connect to the debug server. Use on a production server at your own risk!
Example screenshot of debugger session: