AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [SourcePawn] Debug Server + VSCode Extension (https://forums.alliedmods.net/showthread.php?t=335596)

Garey 12-17-2021 04:22

[SourcePawn] Debug Server + VSCode Extension
 
SourcePawn Debug Adapter and Server for VSCode

An extension for Visual Studio Code that adds support debugging in SourcePawn vm.


Features
  • Breakpoints.
  • Step Into.
  • Step Over.
  • Step Out.
  • Pause.
  • Continue.
  • Show local/global variables.
  • Show callstack.
  • Support multiple sessions.

Installation Instructions
- 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.

Configuration
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:
https://i.imgur.com/XI8G6im.png

Source codes:
Debug Server
VSCode Extension

dran1x 12-28-2021 16:42

Re: [SourcePawn] Debug Server + VSCode Extension
 
Nice one but, could you please provide more info on how to set this up? I'm using windows version on a local server.

Bara 12-31-2021 07:36

Re: [SourcePawn] Debug Server + VSCode Extension
 
Quote:

- Connect to the server by pressing the F5 button.
Well, when I press F5 and select the project it just show me this content:
Code:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "sourcepawn",
            "request": "launch",
            "name": "Run remote debugger",
            "program": "/test"
        }
    ]
}

There's no guide to how to connect to the server, or it only works with a local server (which was not noted).


Beside the above issue I run into the glibc version issue. My server runs with Ubuntu 20.04 (Focal) with the glibc version 2.31, but your precompiled extension was compiled with version 2.32 - which won't on many servers. Probably you could provide a precompiled version compiled against a lower glibc version or add a requirement list with required stuff/versions.


Another point is, you posted this in the "sourcemod" category but named it as "AMXXPawn Debug Adapter and Server for VSCode" which is also pretty confusing.


Generally it could be useful, but with the above list not really user friendly.


All times are GMT -4. The time now is 11:10.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.