PDA

View Full Version : Debugging VSTs


Stu Kennedy
06-02-2009, 03:12 AM
Anyone got any idea how to debug a VST in Visual Studio Express?

(apart from just writing stuff to a file)

schwa
06-02-2009, 05:03 AM
Make a debug build, and run it. The first time you run it, you will be prompted to browse for the executable of whatever host you want to run it in. If you are compiling the host too, you can debug (step through) both simultaneously.

If you are compiling iplug as a static libary, make sure you are creating debug builds of both iplug and your target dll, and linking to the correct one. In MSVC project settings ($Configuration)/ or ($Platform)/$(Configuration)/ can be used as target and link paths which is handy.

Stu Kennedy
06-03-2009, 03:03 AM
hmmm ... I think I tried that, but because my host was not a debug build it wouldn't let me set breakpoints in the project.

I'll try again and check the IPlug build is debug too.

cc_
06-03-2009, 06:44 AM
The other thing to watch out for is that some hosts / 3rd party plugins don't like being run under debuggers, I think it's the copy protection trying to protect itself. Reaper's a good bet if that's your problem.

Stu Kennedy
06-03-2009, 06:49 AM
My host being Reaper of course! :-)

Any chance of a debug build of Reaper Schwa ;-)
lol

schwa
06-03-2009, 07:05 AM
You don't need to run a debug build of the host in order to run your plugin in the debugger. Believe me, I do this all the time. Make a debug build of your plugin and load it in (almost) any host you want, you will then be able to step through your plugin but not through the host.

Most hosts will run OK in the debugger (you can't debug the host, but it will allow itself to be run under the debugger). I know that DP won't and I think there are a couple of others. The release version of Reaper can definitely be used to debug plugins.

Stu Kennedy
06-03-2009, 07:11 AM
Sorry Schwa, I was joking!
The joke obviously got lost in translation :-)

I wasn't expecting you to give me a debug build!

schwa
06-03-2009, 07:21 AM
Must have been the brogue.

bvesco
06-04-2009, 12:24 AM
- create a debug build of your plugin
- attach to the host with the debugger
- set some breakpoints
- notice all breakpoints will be disabled like they won't work
- now load the debug plugin in the host
- notice all breakpoints are now active and will function normally

Note: If you set a breakpoint in the inner processing loop then expect some slowdowns (especially if it is a conditional breakpoint).

Stu Kennedy
06-04-2009, 01:10 AM
Cheers ... I got it working last night (or this afternoon if you're in the States ;-) )

I'd forgotten to copy the debug version to my VST folder after compiling and before debugging.

It's working great now.

ArdeII
09-10-2010, 02:18 AM
From: http://msdn.microsoft.com/en-us/library/605a12zt.aspx

To specify the calling application in a C++ project

1.

In Solution Explorer, select the DLL project.
2.

On the View menu, choose Property Pages.
3.

In the Project Property Pages window, in the Configuration drop-down list, choose Debug.
4.

Open the Configuration Properties folder, and select the Debugging category.
5.

In the Debugger to launch list, choose Local Windows Debugger or Remote Windows Debugger.
6.

In the Command or Remote Command box, click the drop-down arrow, and select Browse from the list to locate the application (Reaper). Alternatively, type the path and name of the application.
7.

Type any necessary program arguments in the Command Arguments box.

mviljamaa
08-24-2015, 11:59 PM
Make a debug build, and run it. The first time you run it, you will be prompted to browse for the executable of whatever host you want to run it in. If you are compiling the host too, you can debug (step through) both simultaneously.

If you are compiling iplug as a static libary, make sure you are creating debug builds of both iplug and your target dll, and linking to the correct one. In MSVC project settings ($Configuration)/ or ($Platform)/$(Configuration)/ can be used as target and link paths which is handy.

What does this mean?

I see IPlug has Configuration Type "Static library (.lib)", but how can I create debug build of IPlug (and target dll)?