How to debug a plugin in Visual Studio (for a Mac guy)

Can anyone please help out a Mac guy? I’m trying to debug my VST/VST3 in Cubase in Visual Studio 2017. This is what I’ve done:

  • In the Properties panel of my VST3 target, I make sure it’s in Debug mode

  • In Debugging->Command -> points to Cubase

  • Debugging -> Attach -> Yes

  • Start up Cubase with a blank document

  • In VS, I set a break point in prepareToPlay() (it’s red)

  • Press the green arrow “Local Windows Debugger” (breakpoint now white and says “Breakpoint will not currently be hit. No symbols have been loaded”…this can’t be good)

  • Add an instrument track with my VST3…it loads and appears, never hit my break point

Anyone? Thanks.

Which location are you building the debug build to… and is the .pdb file created and in the location the debugger expects it?

Rail

I cleaned out my real VST3 folder first…it looks like Cubase was loading that one. I was building straight to the normal JUCE build folder, but I realized that it wasn’t being copied to the Common/VST3 folder so I copied it there and now it hits my breakpoint. Is that what all the Windows devs do? Hand copy it every time? On Mac the debugger attaches just fine where it’s created.

I’m trying to find a crash that my plugin causes when quitting Cubase. I was expecting when I quit that VS would show me where it crashed, but no such luck. Thoughts?

For my Debug build… I have the output and PDB built directly to the Host’s plug-in folder. The intermediate files are still created in the Build folder.

Otherwise have a Post-Build step to copy the files.

Rail

If you’re unsure if the right DLL is loaded, use the Modules window. In the menu: Debug › Windows › Modules. Then search for your DLL. This should tell you the path to the loaded DLL file, and if a PDB file (debugging symbols) was found.

When Cubase crashes, it saves a dump file. How can I see where it crashed?

maybe start with using the JUCE Plugin Host to debug instead of a commercial plugin host first?

I did and it’s fine in the JUCE host…and on a Mac in MainStage.

It’s always Cubase…

You can use FileLogger to create a log at run time.

Rail

Address Sanitizer run?
Yes, we have to copy files on Windows because contrary to MacOS, there is no one common place for all plugins.

You may have to lower the rights on the VST3 folder, in order that the projucer generated post build script can copy the file. Also you can right away Start Cubase through the IDE. No need to attach the debugger afterwards.