Basic Trace Point

by Visual Micro 5. May 2012 14:11

When debuging has been enabled for a configuration a debug session can be started by pressing F5, clicking menu item "Debug>Start With Debugging" or the standard "Start Debugging" icon on the Visual Studio tool bar.

The first thing to note is that two compilations are performed. The first is normal compilation of the sketch to ensure it is free of errors then the second to include debug information. Below you can see the difference in memory between a release and debug build. The difference would be smaller if our test sketch already referenced the serial port and other basic arduino properties. Therefore this example probably represents a worst case senario.

If the serial port monitor was already open prior to upload then Visual Studio automatically displays the debug trace window. Otherwise the serial port monitor should be opened for the trace window to be displayed. The example below shows a running tracepoint. In a real world project we might have multiple break or trace points. Double clicking the trace point will jump to the correct line in the source code.