I’m trying to debug Rack plugins in VS Code on Mac OS. I have a problem launching Rack when debugging, it gives “launch: program ‘Rack’ does not exist” error and doesn’t launch Rack. I tried using “/Applications/Rack” but it doesn’t help. You can find my launch.json below:
"name": "Build and Launch",
"preLaunchTask": "Build application and add to Rack plugin folder"
"name": "Launch Debug",
"preLaunchTask": "Build application and add to Rack plugin folder",
"description": "Enable pretty-printing for gdb",
Thanks in advance
Problem solved by building VCV Rack from source and using resulting executable Rack file.
hi, I have the same problem. can somebody explain me how to get it works?
Hi @swatinogi , it didn’t work with the Rack.app binary I downloaded and gave the error. I then downloaded VCV source code and compiled it which gave me a Rack executable file. When I used that it works.
Now my breakpoint doesn’t work, Rack runs in debugger but no break. It says “Module containing this breakpoint has not yet loaded or the breakpoint address could not be obtained.” Any ideas?
well I don’t know how to figured it out… with my prolem and also with yours @tolga.inci . also to me the source code does not work.
That message usually means that the binary file that’s running, is not the one that the debugger is expecting. Possibly Rack is finding and loading the dll from a directory other than the one you building in.
I suspect submarine is correct, you aren’t loading the version of the plugin that you are building. It looks from the configuration that you are “adding plugin to the rack plugin folder”, but when you build your plugin to run in your own debug version of Rack there is no extra stop to add/install your plugin. Rack just finds it.
The folder structure for this is Rack/plugins/. Are you set up this way?
When you run rack do you see your plugin changes?
The task is below:
"label": "Build application and add to Rack plugin folder",
"command": "make install",
It basically runs make install command from within VS Code. This copies the compiled plugin to user plugin folder, in my case:
I build from within Rack source plugins folder:
I use this path to launch Rack from VS Code:
When Rack is launched while debugging it loads the plugins from “”/Users/tolgainci/Documents/Rack/plugins-v1" folder where I copy them with make install.
Are you saying Rack should load the plugins from “/Users/tolgainci/Documents/Rack/Rack-1/Rack/plugins/” that is my build folder instead? If so how can I achieve this?
Thanks in advance
I discovered something:
When I run Rack by double clicking, or by triggering it within VS Code like this “/Users/tolgainci/Documents/Rack/Rack-1/Rack/Rack” it loads the plugins folder from "“/Users/tolgainci/Documents/Rack/plugins-v1”
When I execute “make run” in the terminal from Rack source directory “/Users/tolgainci/Documents/Rack/Rack-1/Rack/” it correctly loads the plugins from ““/Users/tolgainci/Documents/Rack/Rack-1/Rack/plugins” directory.
So I guess I need this make run behavior in VS code debugging
I finally have the solution, it works! I had actually followed a tutorial for Windows which I think over complicated things.
The solution is here:
I just opened my source Rack folder in VS code, made the settings in c_cpp_properties.json and launch.json and it works as simple as that.
For Mac OS I definitely advise compiling and debugging from Rack source and not the SDK.
Thank you all for your help, I hope someone will find this useful in the future.
yes. your for super don’t want any plugins-v1 nonsense.
I only know the “old way” to do this, and it always works.
my rack is in /c/Rack
my plugins are in /c/Rack/plugins/SquinkyLabsVCV
from /c/Rack I run
make which builds rack
from squinky labs folder I run
make, which builds my plugin, and does not copy them anywhere.
From /c/Rack I run
make run and it runs rack and my new plugin is loaded.
From /c/Rack I run
make debug and it runs gdb, which loads Rack and my plugin and lets me debug them just fine.
In this old workflow there is no need to copy a plugin, since rack looks for them down there already.
The last thing I did was to comment out stripping and optimization by modifying these Rack files:
line 62 # (STRIP) -s dist/"(SLUG)"/$(TARGET)
line 15 # FLAGS += -O3 -march=nocona -funsafe-math-optimizations
Now I can see all my variables and values by hovering on the code. Works like a charm