Raised This Month: $12 Target: $400
 3% 

[SourcePawn] Debug Server + VSCode Extension


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Garey
Member
Join Date: Feb 2008
Location: Russian Federation
Old 12-17-2021 , 04:22   [SourcePawn] Debug Server + VSCode Extension
Reply With Quote #1

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:


Source codes:
Debug Server
VSCode Extension
__________________
Sorry for my bad english

Last edited by Garey; 01-02-2022 at 07:18.
Garey is offline
Send a message via ICQ to Garey
dran1x
Junior Member
Join Date: May 2020
Old 12-28-2021 , 16:42   Re: [SourcePawn] Debug Server + VSCode Extension
Reply With Quote #2

Nice one but, could you please provide more info on how to set this up? I'm using windows version on a local server.
dran1x is offline
Bara
AlliedModders Donor
Join Date: Apr 2012
Location: Germany
Old 12-31-2021 , 07:36   Re: [SourcePawn] Debug Server + VSCode Extension
Reply With Quote #3

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.
__________________
Discord (Bara#5006) | My Plugins (GitHub)
You like my work? Support is not a crime.
Bara is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:00.


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