Programming Howto:Attach the Debugger to a BCI2000 Module
Back
To this howto's overview page.
Switch to debug mode and rebuild
Make sure that the build mode is set to "Debug". If you switched from a different build mode, rebuild by choosing "Build" from the project's context menu.
Create a batch file to start up your configuration
Duplicate a SignalGenerator batch file from the BCI2000 batch directory. Which one you choose may depend on the task your module is going to be used with.
Rename the duplicated file to contain "VeryNiceSignalProcessing" in its name.
Edit the batch file by adding --EvaluateTiming=0 to the SignalGenerator line, and by replacing the signal processing module's name with "VeryNiceSignalProcessing".
Double-click the batch file to start up BCI2000.
Attach the debugger
In the VisualStudio IDE, set a breakpoint in VeryNiceFilter::StartRun(), and choose "Attach to Process..." from the "Debug" menu.
From the process list, choose "Very Nice Signal Processing", and click "Attach".
Verify that execution stops at the breakpoint
In the Operator window, click "Set Config" ...
... and "Start", which will execute VeryNiceFilter::StartRun() ...
... and cause the debugger to stop execution at the breakpoint you set earlier.
You may now step through the code, set more breakpoints, etc. When you are done, don't forget to "Quit" the Operator module from its "File" menu to terminate any BCI2000 modules that are still running.
Next step
As a next step, learn how to programmatically wait for the debugger in a BCI2000 module.