Using VisualGDB with Yocto toolchains

This tutorial shows how to use VisualGDB with cross-toolchains built via the Yocto project. The Yocto cross-toolchains typically run on an x86 or x64 Linux machine and compile code for an embedded ARM boards. Unlike the regular cross-toolchains that have the settings embedded into them, Yocto toolchains require special environment setup files in order to work correctly. This tutorial shows how to use VisualGDB with a Yocto-based toolchain that uses an environment setup file.

Before you begin, install VisualGDB 5.2r8 or later.

  1. Start Visual Studio and open the VisualGDB Linux Project Wizard:01-prj
  2. Select Create a new project -> Application -> Use MSBuild:02-msbuildThe yocto toolchains will also work with GNU Make and CMake build systems.
  3. On the next page choose the computer where you have the Yocto-based toolchain installed and then select “Specify a Yocto environment file” in the “Remote toolchain” field:03-getyocto
  4. Locate and select the environment setup file from your toolchain:04-poky
  5. Select “Deploy the project to another Linux computer” and specify the target board below:05-deploy
  6. Proceed with the default settings on the next page and click “Finish” to create a project:06-sources
  7. VisualGDB will generate a basic project for you. Build it via Ctrl-Shift-B:07-build
  8. You can press F5 to automatically deploy the application to the target board and start debugging it:08-debug
  9. Open the VisualGDB Project Properties and check the environment variables on the MSBuild settings page. Note that the Yocto environment setup file is listed as an environment variable with the “<” prefix. You can use the same syntax everywhere across VisualGDB Project Properties to configure VisualGDB to source environment scripts before running your commands: 09-envvar