Buildspy – For gcc/g++ Users
We have added a new feature to this weekend’s build (623) of Understand called Buildspy that allows gcc/g++ users to create an Understand project during the build. Buildspy picks up files, includes, and macros from the compiler so you don’t have to enter them manually. This can save time and improve project accuracy.
To use Buildspy, you first need to change your compiler from gcc/g++ to gccwrapper/g++wrapper in your makefile or build system. Alternatively, it is possible to override these settings from the command line without having to touch the Makefile using a command like:
buildspy –db example.udb –cmd “make <additional_Make_Options>”
You may also need to add the /SciTools/bin/linux32/buildspy directory to your path.Then, starting with a clean build, run:
buildspy –db path/name.udb –cmd <command to compile project>
This allows Buildspy to receive information from gccwrapper/g++wrapper to build a complete project. The wrappers will then call the corresponding compiler. To change the compiler edit the Buildspy.ini file located at $HOME/.config/SciTools on Linux systems and $HOME/Library/Preferences on Mac.
The wrappers will work with any compiler that has gcc-like syntax. To finish, simply open the project in Understand and Analyze All. Those tedious includes and macros are now set.
We have added support for Buildspy on Windows using Cygwin as of build 633. However, when the buildspy command results in this error:
gcc – Process failed to start: Access is denied.
extra setup is required. Cygwin uses a symlink to access the gcc executable and the actual name of the executable is required in the configuration file. Trace the symlink until the executable is found in order to get the actual name. In my case, the executable was named gcc-3.
On Windows, the configuration file is located in C:Users<USERNAME>AppDataRoamingSciTools and is called Buildspy.ini. Open the Buildspy.ini file and change the compiler name appropriately.
Once this is done, Buildspy should work as expected.
Any feedback on this new feature is welcome and appreciated.
Comments are closed on this post but I want to post some helpful feedback from one of our customers using Buildspy (12/6/13):
I thank SciTools for creating buildspy. I have successfully created a project that appears to be accurate for an embedded Linux kernel.
The steps below allow a consistent approach for a couple different build items. I believe this embedded Linux build could be done more like the description on SciTools web page but some of my other builds worked better using the steps below. I am providing the steps I took in case they will be of use to you or others:
Created arm-poky-linux-gnueabi-gcc and arm-poky-linux-gnueabi-cpp from gccwrapper and g++wrapper in /opt/Understand/bin/linux64/bu
The arm-poky-linux-gnueabi-cpp wrapper script contents are:
Appended “.” to the cross-development environment arm-poky-linux-gnueabi-gcc and arm-poky-linux-gnueabi-cpp in the Yocto ./build/tmp/sysroots/x86_64-li
sourced the Yocto cross-development environment setup script:
bitbake -c devshell virtual/kernel
Before running buildspy in the cross-development environment shell, changed the user name in /opt/Understand/conf/license/u
In the cross-development environment development shell:
buildspy -db ../../../../../../_kernel.orig
Remember to restore the username in /opt/Understand/conf/license/u