Skip to content
Amy edited this page Aug 11, 2024 · 9 revisions

OpenDream has a Debug Adapter Protocol-compatible debugger. The debugger currently requires Visual Studio Code, and optionally a copy of OpenDream's source code if you want to develop OpenDream.

Setup

  1. Install Visual Studio Code.
  2. Install extension DreamMaker Language Client.
  3. Install extension OpenDream dev tools.

Option 1: DM only debugging (the easiest one!)

This option is the one most DM developers will want. It is for debugging DM code only.

  1. Use "Open Folder" to open your DM project.
  2. Press the "Start Debugging (F5)" button.
  3. The extension will automatically set up everything for you and run the compiler, server, and client.

Option 2: create a workspace

This option allows dual DM and C# debugging and is the best option if you are developing OpenDream itself.

  1. Use "Open Folder" to open your DM project.
  2. Use "Add Folder to Workspace" to add your local OpenDream repository to the workspace.
  3. Optionally save the workspace.

Option 3: configure source path

This option lets you compile and run a local copy of OpenDream without needing to download the binaries from Github, but does not let you debug OpenDream itself.

  1. In VSCode's options menu, search "Opendream: Source Path".
  2. Set it to the path to your OpenDream source checkout.

(Optional) Create the task and the launch configuration

  1. Use "Configure Task" to select "OpenDream: compile YourStation.dme" and if you like, set it as a build task.
  2. Use "Debug: Add Configuration", type "OpenDream", and hit Enter to create the launch configuration.
  3. Set these new configurations as defaults if you so choose.

Start

  • First select the OpenDream configuration in the "Run and Debug" tab (Ctrl+Shift+D).
  • Use "Debug: Start Debugging" (F5) to begin.
    • If OpenDream is a workspace folder, the server will also be run with the .NET debugger.
    • The client will be launched and connect to the server after the world initializes.
  • Use "Debug: Start Without Debugging" (Ctrl+F5) to run with the debugger disabled.
  • To pause as soon as possible, use "Debug: Start Debugging and Stop on Entry".

Use

Supported features:

  • Breakpoints
  • Function breakpoints
  • Break on runtime errors
  • Threads, stack traces, arguments/locals/globals
  • Pause, Continue, Step Over, Step In, Step Out
  • Disassembly, instruction stepping, and the bytecode stack