Cmake - VS Code - debugging in Reaper

Hey everyone !
I am posting here because I am working on a new plugin using the Projucer on Visual Studio (OS: Windows 10), but I saw that we can also create Juce plugins using CMake and VS Code.
So I’m trying to export my code from Projucer/VS to CMake/VSCode. I am using this template from Jan Wilczek:
https://github.com/JanWilczek/audio-plugin-template

I used to debug in Reaper with Visual Studio but I’m having a hard time to configure a Reaper debug on VS Code. There’s not a lot of documentation on this :confused:

I saw that you have to create a specific json to that but it is not working for me:
https://forum.juce.com/t/attaching-daw-for-debugging-in-vscode/56677/2?u=frenchjucer

Thanks in advance for your help !

I also moved my project from Projucer to Cmake, and I also debug in Reaper - but I didn’t have to do anything special other than tell CLion what program to use to debug my build, which was as simple as setting the path to reaper.exe.

I did use a combination of FRUT and @sudara’s pamplejuce templates as a guide for my CMake conversion, so maybe I pulled in something that made debugging smoother, but I don’t recall having to use a .json file - perhaps this is a VSCode dependency? Clion has a nice interface for this sort of thing - highly recommended if you’re not married to VSCode.

1 Like

The VS Code docs are very detailed:

Just change the "request": "launch" field to "attach" and by default it will launch with a list of processes to attach to.

1 Like

You can use launch with Reaper:

{
    "name": "Reaper",
    "type": "cppvsdbg",
    "request": "launch",
    "program": "C:/Program Files/REAPER (x64)/reaper.exe",
    "internalConsoleOptions": "openOnSessionStart"
},

You can add a path after reaper.exe to launch a specific reaper project, also.

Thanks everybody for your help, I’ve created a lauch.json and tasks.json to open Reaper correctly.
It works fine !

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Debug VST3 in Reaper",
            "type": "cppvsdbg",  // Use "cppdbg" if you are on Linux/MacOS
            "request": "launch",
            "program": "C:/Program Files/REAPER (x64)/reaper.exe",  // Path to Reaper
            "internalConsoleOptions": "openOnSessionStart",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "console": "integratedTerminal",  
            "preLaunchTask": "build",
        }
    ]
}