gm_rdb. It is meant for local development servers.
Set up with the wizard
1
Start the wizard
Click GLuaLS in the status bar and choose Setup Debugger, or run GLuaLS: Configure Debugger from the Command Palette (
Ctrl+Shift+P).2
Answer the prompts
The wizard asks for your SRCDS folder (it usually finds it for you), the server’s platform, and how your project maps to the server’s files. It then:
- Installs
gm_rdbintogarrysmod/lua/bin/ - Adds
garrysmod/lua/autorun/debug.lua, which starts the debugger when the server loads - Adds a [SERVER] Attach to SRCDS entry to
.vscode/launch.json
3
Restart the server
Restart SRCDS so it loads the module.
4
Connect
Open Run and Debug (
Ctrl+Shift+D), pick [SERVER] Attach to SRCDS and press F5.gm_rdb and debug.lua up to date and asks before installing an update.
Debug the client
The wizard can also install the client module (rdb_client) into your own Garry’s Mod install. It then adds a [CLIENT] Attach to Gmod entry to launch.json.
Join your server with that game install, then start [CLIENT] Attach to Gmod. The client part of debug.lua comes from the server, so the server needs to be set up first.
launch.json options
The wizard writes these for you. You only need to edit them if your layout changes.
If breakpoints never hit,
sourceFileMap is usually wrong. Each entry should map your project folder to the same folder as seen from garrysmod/.
Manual setup
Use this only if the wizard fails.-
Download the module for your server from the GitHub releases:
gmsv_rdb_win64.dll,gmsv_rdb_win32.dll,gmsv_rdb_linux64.dllorgmsv_rdb_linux.dll. -
Put it in
garrysmod/lua/bin/on the server. Create the folder if it does not exist. -
Create
garrysmod/lua/autorun/debug.lua:garrysmod/lua/autorun/debug.lua -
Add an attach entry to
.vscode/launch.json:.vscode/launch.json
debug.lua is enough for breakpoints and stepping. Run Lua on the client and Refresh GLua File need the full file the wizard writes.