Install Arduino GDB for Visual Studio | Follow the standard Visual Micro documentation to create new or open existing Arduino projects. Please use the forum for assistance and feedback. Requires the free Android Tools for Visual Studio to also be installed. You can also use board.txt or boards/platform.txt to add new gdb definitions.

Any visual micro project, with the android tools installed, can now run gdb debug without need for the cross platform projects used previously (still supported). For Gdb, automatic debugging can remain at default state (on).

GDB does not yet support the special break-point commands, such as {@plot}, that can be used with the Visual Micro usb debugger.

Existing users please note - Older project need a minor update

The Visual Micro new project templates now contain two new properties in the .vcproj files. However existing visual micro .vcxproj files currently need to be updated manually (or deleted and re-created using "file>open>arduino project") before GDB will work.

To edit a .vcproj users can right click a project in the solution explorer then click Unload. Then right click again and click "Edit project.vcxproj". Adding the ItemGroup and PropertyGroup shown below will allow gdb to work. fyi: I added them just prior to the existing <ItemGroup> entries.

Right click the project in the solution tree and select Reload project to reload the project again.

Old .vcxproj update to support gdb. Add the following xml:-

<ItemGroup>

<ProjectCapability Include="VisualMicro" />

</ItemGroup>

<PropertyGroup>

<DebuggerFlavor>VisualMicroDebugger</DebuggerFlavor>

</PropertyGroup>

The gdb docs are out of date and being reworked. This document is currently the most up to date.

Visual Micro uses the standard C++ tools of Visual Studio to provide Arduino programming. The C++ tools are a custom option durng install or at a later date via Control Panel>Add or remove programs.

To keep the Visual Micro install small we currently use the Microsoft MI debugger that is installed with the Android tools for Visual Studio. If you are unsure how to install Android >>> Control panel>add or remove programs>visual studio

Visual Micro is installed from within the Ide using "Tools>Extensions & Updates>Online"

The Arduino Ide can be downloaded from the respective hardware vendor such as arduino.cc and arduino.org

Visual Micro no longer expects a special cross platform project type for gdb. Any Visual Studio Arduino project will use gdb debugging if a debug capable (known) board is used. New gdb boards can be added to the config so ask in the forum for more info.

Visual Micro will default to Serial/Usb debugging if a non-gdb compatible board is selected or if Andoid is not installed

To compile, upload and start gdb debug click F5 or "Debug>Start Debugging". To start gdb debugging without compile and upload click "Debug>Attach To Process" (ensure a valid arduino sketch program is already loaded on the board)

Sometimes debug might fail with an error about a missing or busy "port". To resolve this issue open Task Manager and terminate the OpenOCD process if it exists.

Having more than 3 breakpoints can be a problem for many gdb boards so don't use more than 3 otherwise debug will be unstable.

We found that every so often gdb doesn't start. It just shows a windows "connecting to localhost:3333". To resolve click cancel and then start the debug again.

The reason for requiring the Android tools is because the tools installer also installs the "Microsoft MI Debug Engine". Visual Micro actually only needs the debug engine but currently checks for "Java" debug support to determine if it can run Gdb. In the future we will provide an MI Debug Engine installer that doesn't require Android and at that time the check to determine if GDB can be used will be changed from "Java" to some other check.

Some source code paths are incorrect causing temp folder sources instead of local project sources to open during debug.

Stepping line position a little erratic sometimes see instruction stepping when line stepping was selected (maybe resolved in latest android tools dist).

Which backend Ide?

Use arduino.cc Ide for the Zero and use arduino.org for M0 Pro. You can experiment with burning new bootloader onto M0 board but it's not tested so at your own risk (see www public blogs for more info)

Please note: The IoT and Wifi examples mentioned in this document do not currently (15th Jan 2015) work with the Arduino.org backend ide.