> ## Documentation Index
> Fetch the complete documentation index at: https://gluals.arnux.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Debugger overview

> The GLuaLS debugger lets you set breakpoints, inspect variables, and execute Lua directly inside a running SRCDS server.

## 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

<Warning>
  The debugger supports **SRCDS** (dedicated server). Clientside support is still limited. Listen servers are not supported.
</Warning>

* 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

| Feature                     | Details                                                 |
| --------------------------- | ------------------------------------------------------- |
| **Breakpoints**             | Line breakpoints in any `.lua` file in your workspace   |
| **Conditional breakpoints** | Break only when a Lua expression is true                |
| **Step over / into / out**  | Standard stepping controls                              |
| **Call stack**              | Full call stack with source locations                   |
| **Variable inspection**     | Locals, globals, and upvalues at each stack frame       |
| **Variable editing**        | Modify variable values while paused                     |
| **Expression evaluation**   | Evaluate Lua expressions in the Debug Console           |
| **Stop on error**           | Pause when Lua throws an error                          |
| **Stop on entry**           | Pause at the first line when connecting                 |
| **Lua execution**           | Run Lua code, files, or commands from the debug toolbar |
| **Entity explorer**         | Browse entity properties and NetworkVars in a tree view |
| **Realm targeting**         | Send code to the client or server realm independently   |

***

## Next steps

<CardGroup cols={2}>
  <Card title="Setup & installation" icon="wrench" href="/debugger/setup">
    Install gm\_rdb and configure launch.json
  </Card>

  <Card title="Breakpoints & stepping" icon="bug" href="/debugger/breakpoints-and-stepping">
    Set breakpoints and control execution flow
  </Card>

  <Card title="Inspecting variables" icon="magnifying-glass" href="/debugger/inspecting-variables">
    Examine locals, globals, and upvalues
  </Card>

  <Card title="Entity explorer" icon="list-tree" href="/debugger/entity-explorer">
    Browse entities and their properties
  </Card>
</CardGroup>
