Programming Howto:Programmatically wait for the Debugger in a BCI2000 Module

From BCI2000 Wiki
Revision as of 15:31, 16 August 2018 by Mellinger (talk | contribs)

Jump to: navigation, search

Back

To this howto's overview page.

Insert SuggestDebugging

In the VeryNiceFilter constructor, add a line with a SuggestDebugging statement, and rebuild.

Suggest debugging 1.png

Run BCI2000

Double-click the "VeryNiceSignalProcessing" batch file you created earlier.

Suggest debugging 2.png

The VeryNiceFilter constructor is executed at module startup, so a "SuggestDebugging" dialog box will pop up immediately. The dialog box will stay in the front -- you may move it out of the way, but otherwise leave it alone.

Suggest debugging 3.png

Attach the debugger

In the VisualStudio IDE, choose "Attach to Process..." from the "Debug" menu.

Suggest debugging 4.png

Select the "Very Nice Signal Processing" process, click "Attach", and finally dismiss the "SuggestDebugging" dialog box by clicking "yes".

Suggest debugging 5.png

In the call stack, your own code will appear some frames below the top.

Suggest debugging 6.png

Double-clicking your own code's frame will take you to the location of the SuggestDebugging statement.

Suggest debugging 7.png

You may now step through the code, set 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.

Debug 10.png

Next step

As a next step, learn how to deploy a release version of a BCI2000 module.

See also

Programming Howto:Building and Customizing BCI2000