-
Notifications
You must be signed in to change notification settings - Fork 34
Debugging plug ins
You can use Visual Studio + the VisualD extension to have working debugging on Windows.
Generate a .sln solution file with dub generate visuald or dub generate -a x86_64 visuald for 32-bit or 64-bit plugins respectively.
Launch a host program from there. You are now attached.
- Get Visual Studio here: https://visualstudio.microsoft.com/
- Get VisualD here: http://rainers.github.io/visuald/visuald/StartPage.html or with the D installer.
- For Windows arm64, see the tutorial here: https://github.com/dlang/visuald/issues/290#issuecomment-2621878147
- VSCode has an extension called CodeLLDB
- In your
launch.jsonyou can add something like this:
{
"name": "macOS - Reaper",
"type": "lldb",
"request": "launch",
"program": "/Applications/REAPER64.app/Contents/MacOS/REAPER",
"args": [],
}You can use Visual Studio Code and the native-debug extension
- Get Visual Studio Code here: https://visualstudio.microsoft.com/
- Get the
native-debugextension and related instructions here: https://marketplace.visualstudio.com/items?itemName=webfreak.debug
tl;dr Use dplug.core.nogc.debugLog(f) for printf-debugging.
When everything fails, you can use the OutputDebugMessageA Win32 API as a sort of printf replacement, and launch dbgview.exe as an Administrator. This enables a barebones print-based debugging.
- Download DebugView
Warning: Visual Studio may capture the Debug Output to put it in its Output window, in which case dbgview.exe will be silent.
tl;dr Use dplug.core.nogc.debugLog(f) for printf-debugging.
LLDB usually saves the day.
lldb -- /Applications/MyHost.app will launch a LLDB session from the command-line.
At startup, the file .lldbinit is taken as an input command list, this can improve scriptability.
You can then use core.stdc.stdio.printf to debug.
What if you can't attach to the host program? On recent macOS, auval cannot be launched from a debugger due to System Integrity Protection.
- Copy /usr/bin/auvaltool elsewhere e.g. ~/auvaltool, as long as "Debug Executable" is unchecked.
- Codesign the copied auvaltool with your own Mac Developer ID:
codesign -fs "XXXXXXXXXX" ~/auvaltool- You can now hit breakpoint and step through the program.
- On Windows, Carla is a self-extracting ZIP. Rename
Carla.exetoCarla.zipand unpack it. - Carla may also redirect stdout to its internal log console.