Skip to content
wixoa edited this page Aug 19, 2023 · 7 revisions

OpenDream has a Debug Adapter Protocol-compatible debugger. The debugger currently requires Visual Studio Code and a copy of OpenDream's source code.

Setup

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

Option 1: 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 OpenDream source checkout to the workspace.
  3. Optionally save the workspace.

Option 2: configure source path

This option gives faster turnaround if you are not editing or debugging OpenDream itself.

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

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