Programming Howto:Attach the Debugger to a BCI2000 Module: Difference between revisions
No edit summary |
No edit summary |
||
Line 5: | Line 5: | ||
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. | 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. | ||
[[File:debug_1.png]] | [[File:debug_1.png|center]] | ||
Rename the duplicated file to contain "VeryNiceSignalProcessing" in its name. | Rename the duplicated file to contain "VeryNiceSignalProcessing" in its name. | ||
[[File:debug_2.png]] | [[File:debug_2.png|center]] | ||
Edit the batch file by adding <tt>--EvaluateTiming=0</tt> to the SignalGenerator line, and by replacing the signal processing module's name with "VeryNiceSignalProcessing". | Edit the batch file by adding <tt>--EvaluateTiming=0</tt> to the SignalGenerator line, and by replacing the signal processing module's name with "VeryNiceSignalProcessing". | ||
[[File:debug_3.png]] | [[File:debug_3.png|center]] | ||
Double-click the batch file to start up BCI2000. | Double-click the batch file to start up BCI2000. | ||
[[File:debug_4.png]] | [[File:debug_4.png|center]] | ||
==Attach the debugger== | ==Attach the debugger== | ||
In the VisualStudio IDE, set a breakpoint in <tt>VeryNiceFilter::StartRun()</tt>, and choose "Attach to Process..." from the "Debug" menu. | In the VisualStudio IDE, set a breakpoint in <tt>VeryNiceFilter::StartRun()</tt>, and choose "Attach to Process..." from the "Debug" menu. | ||
[[File:debug_5.png]] | [[File:debug_5.png|center]] | ||
From the process list, choose "Very Nice Signal Processing", and click "Attach". | From the process list, choose "Very Nice Signal Processing", and click "Attach". | ||
==Verify that execution stops at the breakpoint== | ==Verify that execution stops at the breakpoint== | ||
[[File:debug_6.png]] | [[File:debug_6.png|center]] | ||
In the Operator window, click "Set Config" ... | In the Operator window, click "Set Config" ... | ||
[[File:debug_7.png]] | [[File:debug_7.png|center]] | ||
... and " | ... and "Start", which will execute <tt>VeryNiceFilter::StartRun()</tt> ... | ||
[[File:debug_8.png]] | [[File:debug_8.png|center]] | ||
and cause the debugger to stop execution at the breakpoint you set earlier. | and cause the debugger to stop execution at the breakpoint you set earlier. | ||
[[File:debug_9.png]] | [[File:debug_9.png|center]] | ||
==Next step== | ==Next step== |
Revision as of 15:11, 16 August 2018
Back
To this howto's overview page.
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.
Next step
As a next step, learn how to programmatically wait for the debugger in a BCI2000 module.