-
Notifications
You must be signed in to change notification settings - Fork 82
Setting up Debugging
- Install the DreamMaker Language Client extension for Visual Studio Code.
- Press Ctrl+Shift+D to access the Debug view.
- Click the "create a launch.json file" link to create a launch configuration.
- On older versions, click the gear icon .
- From now on, pressing F5 will build and run the project.
Add this proc to your codebase and call it at the top of /world/New()
:
/world/proc/enable_debugger()
var/dll = world.GetConfig("env", "EXTOOLS_DLL")
if (dll)
call(dll, "debug_initialize")()
The debugging hooks will automatically activate when the project is run with F5. Use Ctrl+F5 to run without debugging. The debugging hooks will not activate when not configured, so this code can be safely committed to source control.
For a general overview, read Debugging in Visual Studio Code.
Edit launch.json
and remove or comment out the "preLaunchTask"
line.
DreamSeeker and the debug hooks will work under Wine with no additional configuration. Use an attach configuration if running DreamDaemon under Wine. Debugging the Linux-native DreamDaemon is not currently supported.
Mode and port parameters can be passed to debug_initialize
. The default is as if you had written:
var/mode = world.GetConfig("env", "EXTOOLS_MODE") || "NONE"
var/port = world.GetConfig("env", "EXTOOLS_PORT") || "2448"
call(dll, "debug_initialize")(mode, port)
Set EXTOOLS_MODE
when running DreamSeeker or DreamDaemon or adjust enable_debuger
to pass one of the following modes:
- BACKGROUND: listen for connections on the given port in the background.
- BLOCK: wait for a connection on the given port before resuming.
Edit launch.json
, click "Add Configuration", and choose "BYOND: Attach to debugger". Ensure the
port numbers match.
Read more about world.GetConfig.
To ensure compatibility, debug adapter releases bundle a copy of the extools.dll
debugging hooks which they know how to communicate with and set EXTOOLS_DLL
accordingly. To use a locally built DLL, set the dreammaker.extoolsDLL
key in Visual Studio Code's settings.json
.
The debug adapter also sets EXTOOLS_MODE
and EXTOOLS_PORT
to appropriate values automatically.