Skip to main content

Overview

GLuaLS includes a full source-level debugger for Garry’s Mod servers. You can set breakpoints, step code, inspect variables, edit values, and run Lua from VS Code while the game is running. The VS Code extension can download the right gm_rdb build and guide you through installation.

How it works

The debugger uses the LRDB (Lua Remote Debugger) protocol over TCP:
  1. gm_rdb: a Garry’s Mod binary module loaded by SRCDS. It talks to the game engine and exposes a TCP debug endpoint.
  2. GLuaLS Extension: the VS Code extension connects to the TCP endpoint started by the binary module. It sends commands and receives data.
Your Lua files are served from source paths in your workspace, so local breakpoints map to the running code.

Requirements

The debugger supports SRCDS (dedicated server). Clientside support is still limited. Listen servers are not supported.
  • SRCDS (dedicated server) running on Windows or Linux
  • gm_rdb binary module installed in your server’s garrysmod/lua/bin/
  • debug.lua loader script in garrysmod/lua/autorun/
  • VS Code with the GLuaLS extension
  • Network access from your machine to the server (for remote debugging)

Feature summary

FeatureDetails
BreakpointsLine breakpoints in any .lua file in your workspace
Conditional breakpointsBreak only when a Lua expression is true
Step over / into / outStandard stepping controls
Call stackFull call stack with source locations
Variable inspectionLocals, globals, and upvalues at each stack frame
Variable editingModify variable values while paused
Expression evaluationEvaluate Lua expressions in the Debug Console
Stop on errorPause when Lua throws an error
Stop on entryPause at the first line when connecting
Lua executionRun Lua code, files, or commands from the debug toolbar
Entity explorerBrowse entity properties and NetworkVars in a tree view
Realm targetingSend code to the client or server realm independently

Next steps

Setup & installation

Install gm_rdb and configure launch.json

Breakpoints & stepping

Set breakpoints and control execution flow

Inspecting variables

Examine locals, globals, and upvalues

Entity explorer

Browse entities and their properties