Updating Data

Once you have initially added the data sources into the project, the Imagix 4D database may become unsynchronized with your software, due to changes you make in your source code. Symptoms of this include symbols no longer being colored in the Imagix 4D File Editor, due to changes in line numbers. In resynchronizing the project database to your source code, you have options about whether to update the database about your full set of source code or just those portions that have changed. In addition, there are both manual and automatic alternatives for keeping the information in the project current with the actual state of your changing software.

You may choose to combine these approaches. For example, you can manually invoke the Update Project Data function during the day to capture the incremental edits you make to your code, and then automatically run the full data collection commands as part of a nightly cron job to completely rebuild the database information.

Incremental vs. Full Update

Incremental data collection, where data is recollected only if the data source has changed, is available through the Project > Update Project Data menu item.

For source code data, this data recollection is rather granular. For source code loaded other than through the Add Targets to Makefile approach, Update Project Data causes data to be recollected only for those source files which have been modified, or whose include files have been modified, since the last collection. For example, if the only change has been to one header file, data is collected only for those C and C++ source files which directly or indirectly include that particular header file. The granularity of the Add Targets to Makefile approach depends on settings in the Data Collection Options dialog, and how you have your makefiles structured.

Once the minimal data has been recollected for the Source Files data sources, any Profile Data and Other data sources are once again loaded.

The Project > Regenerate Project Data menu item causes all data to be recollected. This ensures that the project captures the latest state of all of your data sources, and eliminates superseded data from the datafiles. However, it takes longer than the incremental update since all the data sources are once again analyzed.

Manual vs. Automated Update

The manual approach for updating Imagix 4D project data is through the Project menu (Project > Update Project Data) and (Project > Regenerate Project Data). Alternatively, you can automatically recollect the data sources as part of your recompilation or nightly build processes. This enables the recollection to occur off-line, while no one is waiting.

There are several ways to cause the initiate data recollection from the command line. A couple of these involve invoking the appropriate Imagix 4D analyzer directly, as a command line driven executable.

This is in fact what the Add Targets to Makefile approach for C and C++ does, by adding targets to your makefile that invoke the imagix-csrc analyzer. If you're using makefile-based analysis, there will be some targets in your makefile of the form `imagix' and `imagix_update'. These will cause the full and incremental re-analysis of your code, respectively. Under this approach, you'd add a command something like `make -f makefile imagix' to your cron job or nightly build script.

If you're not using the makefile-based approach to analyze your software, you can still invoke the Imagix 4D analyzer directly from a command line.

However, you will probably find that the easiest technique for automated data collection is to use the -cmmd option for invoking Imagix 4D itself. This causes Imagix 4D to operate in batch mode, where it starts up, runs whatever series of commands you have specified, and then exits. You can specify a set of commands that cause Imagix 4D to open a (series of) project and regenerate all the project data each project. This will cause the project data to resynchronize with your software.

Under this approach, you'd add a command along the lines of `imagix -cmmd cmmdfile' to your cron job or nightly build script. Refer to Batch Mode Commands for more information on batch mode, and the format of the cmmdfile.