Recommended Settings for Visual Studio

Related Topics

 

These settings apply to Visual Studio .NET, Visual Studio 2005 and Visual Studio 2008.

For managed code

If you intend the data you collect to include line numbers, debug data must be available to your Rational Runtime Analysis tool. To provide debug data, select Debug configuration in the Visual Studio Configuration Manager. Alternatively, compile with the /debug switch when you compile your program.

Consult your compiler manual for information about the location of debug data. For languages such as C#, managed C++, and managed Visual Basic, the debug data is present in .pdb files.

For native-compiled (unmanaged) code

Here are the settings for Visual Studio that work best with Rational Runtime Analysis tools for native-compiled (unmanaged) code.

1.    In the Property Pages for your project, C/C++ folder, General page:

Select Program Database in the Debug Information Format property drop-down list box.

2.    In the C/C++ folder, Code Generation page:

Select Default in the Basic Runtime Checks property drop-down list box.
This option setting disables the VC compiler's stack frame checking.

3.    In the Linker folder, General page:

Select No in the Enable Incremental Linking property drop-down list box.

4.    In the Linker folder, Command Line page:

In the Additional Options box add: /fixed:no.
This adds relocation information to your image file.

 

5.    In the C/C++ folder, Optimization page:

§        Set Optimization to Disabled.

§        For Visual Studio 2005 and Visual Studio 2008, set Whole Program Optimization to No.

6.    In the Linker folder, Input page:

§    Clear Delay Loaded Dlls. If you must use this setting then you need to exclude the module that is built with this setting from instrumentation.

After changing your Visual Studio settings, you should always:

§      Rebuild your application.

§      Verify that the .pdb file for the .exe or .dll is in the same directory as the corresponding .exe or .dll. The .pdb file contains the Microsoft format symbol information. If you move your .exe or .dll to a working directory, you must also move the corresponding .pdb file.

§      Clear your product's cache directory before running again. This forces reinstrumentation of the newly updated files.

Utility to check settings for multiple projects

PurifyPlus provides a script that can verify (and optionally correct) settings for Visual Studio solutions or projects. This tool is located in <install_dir>\Program Files\Rational\PurifyPlus\Utilities\ScanVSSolutionForPurifyPlus.pl. Here’s the readme for that script.

Notes:

§  A .dll from the Microsoft Debugger Interface Access SDK is used to collect debug data from pdb files generated by Visual Studio 2005 and Visual Studio 2008. They each use a different dll. The 2008 version will read debug data generated by Visual Studio 2005, but the reverse is not true. This dll is installed by default with either Visual Studio 2005 or Visual Studio 2008. It’s a redistributable package, and the 2005 redistributable is installed as <install dir>\ Microsoft Visual Studio 8\SDK\ v2.0\Bootstrapper\Packages\vcredist_x86\vcredist _x86.exe. Visual Studio 2008 installs the SDK to <install dir>\ Microsoft Visual Studio 9.0\DIA SDK. You may need to run the appropriate redistributable to install DIA if you want to run your program on a different machine than that where Visual Studio 2005 or 2008 is installed.

(C) Copyright IBM Corporation 1993, 2009.