Debug in VSCode with Rack-SDK?

I don’t know, I don’t use Visual Studio Code. What command does make install run? Does log.txt say it extracts?

@Vortico make install its the script you have done :slight_smile: It correctly make the .zip and copy on my user document’s folder. Than, gdb load the Rack.exe (as write in the config above).

Here’s Rack.exe log when I open it manually (with the zip dist there with only make install):

[0.000 info src/main.cpp:67] VCV Rack 0.6.2c
[0.000 info src/main.cpp:70] Global directory: C:\Program Files\VCV\Rack/
[0.000 info src/main.cpp:71] Local directory: C:\Users\tcdalmar\Documents/Rack/
[0.000 info src/plugin.cpp:303] Extracting package C:\Users\tcdalmar\Documents/Rack/plugins/NWK-0.6.2c-win.zip
[0.031 info src/plugin.cpp:125] Loaded plugin AS 0.6.13 from C:\Users\tcdalmar\Documents/Rack/plugins/AS/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin AudibleInstruments 0.6.3 from C:\Users\tcdalmar\Documents/Rack/plugins/AudibleInstruments/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin Befaco 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Befaco/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin Blamsoft-XFXDistortionPack 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Blamsoft-XFXDistortionPack/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin Blamsoft-XFXF35 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Blamsoft-XFXF35/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin Blamsoft-XFXReverb 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Blamsoft-XFXReverb/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin Blamsoft-XFXWave 0.6.1 from C:\Users\tcdalmar\Documents/Rack/plugins/Blamsoft-XFXWave/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin Bogaudio 0.6.13 from C:\Users\tcdalmar\Documents/Rack/plugins/Bogaudio/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin Edge 0.6.3 from C:\Users\tcdalmar\Documents/Rack/plugins/Edge/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin ESeries 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/ESeries/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin Fundamental 0.6.2 from C:\Users\tcdalmar\Documents/Rack/plugins/Fundamental/plugin.dll
[0.031 info src/plugin.cpp:125] Loaded plugin Grayscale 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Grayscale/plugin.dll
[0.046 info src/plugin.cpp:125] Loaded plugin HetrickCV 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/HetrickCV/plugin.dll
[0.046 info src/plugin.cpp:125] Loaded plugin Hora-ModulationFree 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Hora-ModulationFree/plugin.dll
[0.046 info src/plugin.cpp:125] Loaded plugin ImpromptuModular 0.6.16 from C:\Users\tcdalmar\Documents/Rack/plugins/ImpromptuModular/plugin.dll
[0.046 info src/plugin.cpp:125] Loaded plugin JW-Modules 0.6.3 from C:\Users\tcdalmar\Documents/Rack/plugins/JW-Modules/plugin.dll
[0.046 info src/plugin.cpp:125] Loaded plugin LOGinstruments 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/LOGinstruments/plugin.dll
[0.046 info src/plugin.cpp:125] Loaded plugin mscHack 0.6.3 from C:\Users\tcdalmar\Documents/Rack/plugins/mscHack/plugin.dll
[0.046 info src/plugin.cpp:125] Loaded plugin MSM 0.6.51 from C:\Users\tcdalmar\Documents/Rack/plugins/MSM/plugin.dll
[0.124 info src/plugin.cpp:125] Loaded plugin NWK 0.6.2c from C:\Users\tcdalmar\Documents/Rack/plugins/NWK/plugin.dll
[0.124 info src/plugin.cpp:125] Loaded plugin NYSTHI 0.6.42 from C:\Users\tcdalmar\Documents/Rack/plugins/NYSTHI/plugin.dll
[0.124 info src/plugin.cpp:125] Loaded plugin PvC 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/PvC/plugin.dll
[0.124 info src/plugin.cpp:125] Loaded plugin RJModules 0.6.1 from C:\Users\tcdalmar\Documents/Rack/plugins/RJModules/plugin.dll
[0.124 info src/plugin.cpp:125] Loaded plugin Valley 0.6.16 from C:\Users\tcdalmar\Documents/Rack/plugins/Valley/plugin.dll
[0.124 info src/plugin.cpp:125] Loaded plugin VultModulesFree 0.6.25 from C:\Users\tcdalmar\Documents/Rack/plugins/VultModulesFree/plugin.dll
[0.242 info src/bridge.cpp:339] Bridge server started
[0.270 info src/window.cpp:642] Loaded font C:\Program Files\VCV\Rack/res/fonts/DejaVuSans.ttf
[0.270 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_146097_cc.svg
[0.270 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_31859_cc.svg
[0.270 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1343816_cc.svg
[0.270 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1343811_cc.svg
[0.270 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1084369_cc.svg
[0.271 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1745061_cc.svg
[0.271 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1240789_cc.svg
[0.271 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_305536_cc.svg
[0.271 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_468341_cc.svg
[0.271 info src/settings.cpp:172] Loading settings C:\Users\tcdalmar\Documents/Rack/settings.json
[0.274 info src/settings.cpp:158] Saving settings C:\Users\tcdalmar\Documents/Rack/settings.json
[0.274 info src/app/RackWidget.cpp:143] Loading patch C:\Users\tcdalmar\Documents/Rack/autosave.vcv
[2.862 info src/app/RackWidget.cpp:128] Saving patch C:\Users\tcdalmar\Documents/Rack/autosave.vcv
[2.862 info src/settings.cpp:158] Saving settings C:\Users\tcdalmar\Documents/Rack/settings.json
[2.900 warn src/bridge.cpp:321] Bridge server close() failed

As you can see, there’s Extracting package line: it works!!!.

Now, I delete that folder, the zip.
I than Run F5 on VSCode, which call make install again (generating the zip correctly on the folder) and start automatically Rack.exe.

But here’s the log now:

[0.000 info src/main.cpp:67] VCV Rack 0.6.2c
[0.000 info src/main.cpp:70] Global directory: C:\Program Files\VCV\Rack/
[0.000 info src/main.cpp:71] Local directory: C:\Users\tcdalmar\Documents/Rack/
[0.077 info src/plugin.cpp:125] Loaded plugin AS 0.6.13 from C:\Users\tcdalmar\Documents/Rack/plugins/AS/plugin.dll
[0.147 info src/plugin.cpp:125] Loaded plugin AudibleInstruments 0.6.3 from C:\Users\tcdalmar\Documents/Rack/plugins/AudibleInstruments/plugin.dll
[0.194 info src/plugin.cpp:125] Loaded plugin Befaco 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Befaco/plugin.dll
[0.288 info src/plugin.cpp:125] Loaded plugin Blamsoft-XFXDistortionPack 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Blamsoft-XFXDistortionPack/plugin.dll
[0.381 info src/plugin.cpp:125] Loaded plugin Blamsoft-XFXF35 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Blamsoft-XFXF35/plugin.dll
[0.478 info src/plugin.cpp:125] Loaded plugin Blamsoft-XFXReverb 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Blamsoft-XFXReverb/plugin.dll
[0.584 info src/plugin.cpp:125] Loaded plugin Blamsoft-XFXWave 0.6.1 from C:\Users\tcdalmar\Documents/Rack/plugins/Blamsoft-XFXWave/plugin.dll
[0.694 info src/plugin.cpp:125] Loaded plugin Bogaudio 0.6.13 from C:\Users\tcdalmar\Documents/Rack/plugins/Bogaudio/plugin.dll
[0.757 info src/plugin.cpp:125] Loaded plugin Edge 0.6.3 from C:\Users\tcdalmar\Documents/Rack/plugins/Edge/plugin.dll
[0.835 info src/plugin.cpp:125] Loaded plugin ESeries 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/ESeries/plugin.dll
[0.913 info src/plugin.cpp:125] Loaded plugin Fundamental 0.6.2 from C:\Users\tcdalmar\Documents/Rack/plugins/Fundamental/plugin.dll
[0.976 info src/plugin.cpp:125] Loaded plugin Grayscale 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Grayscale/plugin.dll
[1.073 info src/plugin.cpp:125] Loaded plugin HetrickCV 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/HetrickCV/plugin.dll
[1.131 info src/plugin.cpp:125] Loaded plugin Hora-ModulationFree 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/Hora-ModulationFree/plugin.dll
[1.240 info src/plugin.cpp:125] Loaded plugin ImpromptuModular 0.6.16 from C:\Users\tcdalmar\Documents/Rack/plugins/ImpromptuModular/plugin.dll
[1.334 info src/plugin.cpp:125] Loaded plugin JW-Modules 0.6.3 from C:\Users\tcdalmar\Documents/Rack/plugins/JW-Modules/plugin.dll
[1.412 info src/plugin.cpp:125] Loaded plugin LOGinstruments 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/LOGinstruments/plugin.dll
[1.522 info src/plugin.cpp:125] Loaded plugin mscHack 0.6.3 from C:\Users\tcdalmar\Documents/Rack/plugins/mscHack/plugin.dll
[1.632 info src/plugin.cpp:125] Loaded plugin MSM 0.6.51 from C:\Users\tcdalmar\Documents/Rack/plugins/MSM/plugin.dll
[1.870 info src/plugin.cpp:125] Loaded plugin NYSTHI 0.6.42 from C:\Users\tcdalmar\Documents/Rack/plugins/NYSTHI/plugin.dll
[1.969 info src/plugin.cpp:125] Loaded plugin PvC 0.6.0 from C:\Users\tcdalmar\Documents/Rack/plugins/PvC/plugin.dll
[2.074 info src/plugin.cpp:125] Loaded plugin RJModules 0.6.1 from C:\Users\tcdalmar\Documents/Rack/plugins/RJModules/plugin.dll
[2.181 info src/plugin.cpp:125] Loaded plugin Valley 0.6.16 from C:\Users\tcdalmar\Documents/Rack/plugins/Valley/plugin.dll
[2.291 info src/plugin.cpp:125] Loaded plugin VultModulesFree 0.6.25 from C:\Users\tcdalmar\Documents/Rack/plugins/VultModulesFree/plugin.dll
[3.580 info src/bridge.cpp:339] Bridge server started
[4.158 info src/window.cpp:642] Loaded font C:\Program Files\VCV\Rack/res/fonts/DejaVuSans.ttf
[4.158 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_146097_cc.svg
[4.158 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_31859_cc.svg
[4.158 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1343816_cc.svg
[4.158 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1343811_cc.svg
[4.158 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1084369_cc.svg
[4.158 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1745061_cc.svg
[4.158 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_1240789_cc.svg
[4.158 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_305536_cc.svg
[4.158 info src/window.cpp:695] Loaded SVG C:\Program Files\VCV\Rack/res/icons/noun_468341_cc.svg
[4.158 info src/settings.cpp:172] Loading settings C:\Users\tcdalmar\Documents/Rack/settings.json
[4.380 info src/settings.cpp:158] Saving settings C:\Users\tcdalmar\Documents/Rack/settings.json
[4.380 info src/app/RackWidget.cpp:143] Loading patch C:\Users\tcdalmar\Documents/Rack/autosave.vcv
[6.037 info src/app/RackWidget.cpp:128] Saving patch C:\Users\tcdalmar\Documents/Rack/autosave.vcv
[6.037 info src/settings.cpp:158] Saving settings C:\Users\tcdalmar\Documents/Rack/settings.json
[6.545 warn src/bridge.cpp:321] Bridge server close() failed

As you can see, the only line that is missing is the Extracting package.
It doesn’t extract (+ replace) the folder.

Not really sure what it can be. Is there some param to pass to rack? I don’t think…
Also permission: if vscode is able to create/copy a zip, I believe the same process is able to unzip.

Right?

I meant “post what make install runs”, since it needs to expand certain variables.

You also haven’t given any information whatsoever about your system, so basically everything anyone posts here is utter guesswork.

You should make sure that each step is completed successfully by VSCode, using its console or whatever.

@Vortico: right, sorry!

Here’s my system: Windows 10 Professional, 64bit, MinGW (gcc + gdb) and VSCode.
Here’s the output of make install:

> Executing task: make install <

g++  -Wsuggest-override -std=c++11  -DSLUG=NWK -fPIC -I../../include -I../../dep/include -DVERSION=0.6.2c -MMD -MP -g -O0 -march=nocona -ffast-math -fno-finite-math-only -Wall -Wextra
-Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES -c -o build/src/Default.cpp.o src/Default.cpp
g++  -Wsuggest-override -std=c++11  -DSLUG=NWK -fPIC -I../../include -I../../dep/include -DVERSION=0.6.2c -MMD -MP -g -O0 -march=nocona -ffast-math -fno-finite-math-only -Wall -Wextra
-Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES -c -o build/src/Modwhk.cpp.o src/Modwhk.cpp
g++  -Wsuggest-override -std=c++11  -DSLUG=NWK -fPIC -I../../include -I../../dep/include -DVERSION=0.6.2c -MMD -MP -g -O0 -march=nocona -ffast-math -fno-finite-math-only -Wall -Wextra
-Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES -c -o build/src/Enwhk.cpp.o src/Enwhk.cpp
g++  -Wsuggest-override -std=c++11  -DSLUG=NWK -fPIC -I../../include -I../../dep/include -DVERSION=0.6.2c -MMD -MP -g -O0 -march=nocona -ffast-math -fno-finite-math-only -Wall -Wextra
-Wno-unused-parameter -DARCH_WIN -D_USE_MATH_DEFINES -c -o build/src/NWK.cpp.o src/NWK.cpp
g++ -o plugin.dll build/src/Default.cpp.o build/src/Modwhk.cpp.o build/src/Enwhk.cpp.o build/src/NWK.cpp.o  -shared -L../.. -lRack
rm -rf dist
mkdir -p dist/NWK
cp plugin.dll dist/NWK/
#strip -s dist/NWK/plugin.dll
cp -R LICENSE.txt res dist/NWK/
cd dist && zip -5 -r NWK-0.6.2c-win.zip NWK
  adding: NWK/ (stored 0%)
  adding: NWK/LICENSE.txt (deflated 60%)
  adding: NWK/plugin.dll (deflated 76%)
  adding: NWK/res/ (stored 0%)
  adding: NWK/res/Default.svg (deflated 76%)
  adding: NWK/res/Enwhk.svg (deflated 69%)
  adding: NWK/res/Modwhk.svg (deflated 69%)
  adding: NWK/res/Screw.svg (deflated 64%)
cp dist/NWK-0.6.2c-win.zip C:\Users\tcdalmar/Documents/Rack/plugins/

@Vortico
Here happens the same thing with the same confuguration system,
Rack executed with GDB from VSCODE, it does not unzip the plugin in the default local folder.
I want to add that VSCODE:
when the plugin is unzipped and present, it works fine, I can debug with GDB without problem.

@Richie
Please you could post your configuration files for Visual Studio so I could try it?

1 Like

@flowstoner Sure: my Rack checkout is in C:\src\Rack\Rack, with the executable at C:\src\Rack\Rack\Rack.exe. My launch.vs.json is in C:\src\Rack\Rack\.vs and looks like this:

{
    "version": "0.2.1",
    "defaults": {},
    "configurations": [
        {
            "type": "cppdbg",
            "name": "Rack.exe",
            "project": "Rack.exe",
            "cwd": "${workspaceRoot}",
            "program": "${debugInfo.target}",
            "MIMode": "gdb",
            "miDebuggerPath": "${env.MINGW_PREFIX}\\bin\\gdb.exe",
            /*"externalConsole": true,*/
            "args": [
                "-d"
            ]
        }
    ]
}

One thing to beware of: the default .gitignore for Rack includes Rack.exe, which prevents Visual Studio from showing it in Solution Explorer. It took me a while to figure out why I couldn’t see it!

1 Like

@Richie Thanks!
This is to launch and debug Rack itself with GDB, but with the -d flag Rack not load any external module, only the core one,
ours problems is that Rack(no -d flag) not unzip the plugin when loaded with GDB.

Anyway, now visual studio correctly supports the intellisense with gcc? the last time I tried to configure it didn’t work properly. If you use it and confirm that it works well, could you also share your .json configuration?

1 Like

@flowstoner: I have no configuration for IntelliSense. I’m using the Open Folder feature of Visual Studio with my Rack checkout and it all just works.

1 Like

@Richie Ok, need to try Visual Studio again. What version are you using, VS2017 15.x ?

Yes: VS2017 Community, 15.9.7.

2 Likes

We have lots of stuff now. We just need the @Vortico answer of why its unable to unzip :smile:

1 Like

This is an old post but I got debugging working in part thanks to it. So i guess I will share how i did it.

I have a “Rack-SDK” folder and inside it a “.vscode” folder with this files.

settings.json

{
  {
    "terminal.integrated.shell.windows": "c:\\msys64\\usr\\bin\\bash.exe",
    "terminal.integrated.shellArgs.windows": ["--login"],
    "terminal.integrated.env.windows": {
        "CHERE_INVOKING": "1",
        "MSYSTEM": "MINGW64"
    }
}

task.json

{
  {
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build VCV Rack plugin",
            "type": "shell",
            "command": "make install -j4",
            "options": {
                "cwd": "${workspaceFolder}/plugins/LomasModules",
                "env": {
                    "PATH": "C:\\msys64\\usr\\bin\\;C:\\msys64\\mingw64\\bin"
                }
            },
            "problemMatcher": {
                "owner": "cpp",
                "fileLocation": [
                    "absolute"
                ],
                "pattern": {
                    "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
                    "file": 1,
                    "line": 2,
                    "column": 3,
                    "severity": 4,
                    "message": 5
                }
            }
        },
        {
            "label": "Build VCV Rack plugin & lauch Rack",
            "type": "process",
            "command": "C:\\Program Files\\VCV\\Rack\\Rack.exe",
            "problemMatcher": [],
            "dependsOn": ["Build VCV Rack plugin"],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

launch.json

{
  {
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) Launch",
            "type": "cppdbg",
            "request": "launch",
            "program": "C:\\Program Files\\VCV\\Rack\\Rack.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "C:/msys64/mingw64/bin/gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "Build VCV Rack plugin"
        }
    ]
}

After those files gdb started running but line breakpoints did not work. The key was what @Richie said:

ifdef ARCH_MAC
	$(STRIP) -S dist/$(SLUG)/$(TARGET)
else
	# RJH $(STRIP) -s dist/$(SLUG)/$(TARGET)
endif

After commenting that line the breakpoints are working.

If you want to use the files you will have to change the plugin relative path “${workspaceFolder}/plugins/LomasModules” to point to your plugin folder. Also you may need to change the paths to gdb, gcc, and rack. I have MSYS2 on c: and Rack on Program Files.

3 Likes

Okay then. I’m going ahead and share my debug config for MacOS. I didn’t use the SDK but checked out the complete VCVRack from github and compiled it.

Using the C/C++ Extension from Microsoft.

Rack/.vscode/c_cpp_properties.json

{
  "configurations": [
    {
      "name": "Mac",
      "includePath": ["${workspaceFolder}/**"],
      "defines": [],
      "macFrameworkPath": [
        "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks",
      ],
      "compilerPath": "/usr/bin/clang",
      "cStandard": "c11",
      "cppStandard": "c++11",
      "intelliSenseMode": "clang-x64"
    }
  ],
  "version": 4
}

Rack/.vscode/launch.json

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "(lldb) Launch",
      "type": "cppdbg",
      "request": "launch",
      "program": "Rack",
      "args": ["-d"],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "externalConsole": false,
      "MIMode": "lldb"
    }
  ]
}

I’m not using a launch task, just using the terminal for executing make make dep for Plugins but not installing them. I’m running Rack from the source folder of rack and the plugins subdirectory. Works like a charm. And you have two isolated environments, when running Rack in development mode with "args": ["-d"].

2 Likes

Yep! This worked for me as well. I’ve got my plugin debugging working after removing the $(STRIP) command. strip -s removes the debugger symbols as commented in compile.mk and confirmed here. I’ve added a makefile argument that I set from the command line to alternate between stripping and not stripping depending on if I want to debug or not.

Thanks for the confirmation @lomasmodules and the help @Richie! Now I can really dive into some fun!

FYI:

I’ve written a more detailed article on how I got my Windows environment setup for step by step debugging and building. Hope it helps!

4 Likes

Could some kind, patient individual talk me through how to get VS Code debugging working under linux please?

Ok, could someone help me just to get the damn thing to build upon hitting F5? If I can get that working perhaps I’ll be able to sort the debugging out myself.

c_ccp_properties.json:

{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "${workspaceFolder}/**",
                "/home/ewen/Rack/**",
                "/home/ewen/Rack-SDK/dep/**",
                "/home/ewen/Rack-SDK/include/**"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}

tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "build vcv rack plugin",
            "type": "shell",
            "command": "make install",
            "options": {
                "cwd": "${workspaceRoot}",
                "env": {
                    "RACK_DIR": "/home/ewen/Rack-SDK/**"
                }
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "type": "shell",
            "label": "g++ build active file",
            "command": "/usr/bin/g++",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "/usr/bin"
            }
        }
    ]
}

Output:

> Executing task in folder RacketScience: /usr/bin/g++ -g /home/ewen/Rack/plugins/RacketScience/src/RSPhaseOne.cpp -o /home/ewen/Rack/plugins/RacketScience/src/RSPhaseOne <

In file included from /home/ewen/Rack/plugins/RacketScience/src/RSPhaseOne.cpp:3:0:
/home/ewen/Rack/plugins/RacketScience/src/plugin.hpp:2:10: fatal error: rack.hpp: No such file or directory
 #include <rack.hpp>
          ^~~~~~~~~~
compilation terminated.
The terminal process terminated with exit code: 1

Running make install in the terminal works fine.

Clueless, frustrated & grateful for any assistance.

In task.json try to put your plugin folder

“cwd”: “${workspaceRoot}/plugins/pluginname”

I use ctrl+B to run it, not F5.

Thanks, no change.

I use emacs, but from looking at the json, why do you have a ** after the Rack-SDK directory?

env": {
                    "RACK_DIR": "/home/ewen/Rack-SDK/**"
                }

That looks wrong. I thought ** expanded directories.

If RACK_DIR is set wrong you won’t find rack.hpp

Thanks, amended, no change.