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.
- Start Visual Studio and open the VisualGDB Linux Project Wizard:
- Select Create a new project -> Application -> Use MSBuild:The yocto toolchains will also work with GNU Make and CMake build systems.
- 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:
- Locate and select the environment setup file from your toolchain:
- Select “Deploy the project to another Linux computer” and specify the target board below:
- Proceed with the default settings on the next page and click “Finish” to create a project:
- VisualGDB will generate a basic project for you. Build it via Ctrl-Shift-B:
- You can press F5 to automatically deploy the application to the target board and start debugging it:
- 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: