The SansGUI environment that you installed on your computer was built with a multi-threading library in the Release mode. It does not include any debugging information and symbols. However, you can still debug and trace into your own in-process simulator DLLs in the supported interactive development environments (IDEs) in conjunction with SansGUI. Prior to getting into any debug session, you need to have the DLL project created and set it up as described in the Developing In-Process Simulators chapter of this manual. In this section, we assume that your IDE has been configured as described in the Preparing Development Environments section and the simulator DLL has been built according to the instructions in the Creating DLL Projects section.
Because the SansGUI program was built with the multi-threading (MT) library in the Release mode, the Debug mode automatically created for your DLL project will not be compatible with the SansGUI environment that you installed. As a matter of fact, if you run the Debug build of your simulator DLL in the SansGUI environment, the simulation thread may crash. It is recommended that you debug and trace your simulator DLL code by creating a separate Trace mode based upon the Release mode with the following modifications to include debug information:
From the Visual C++ IDE with your DLL project loaded, select Build>Configurations... to obtain the Configurations dialog.
Click on the Add... button to obtain the Add Project Configuration dialog.
In the Configuration field, enter Trace to replace Release or Debug.
In the Copy settings from: field, make sure the Win32 Release configuration is selected.
In the Platform field, it should be Win32.
Click on the OK button, a new Win32 Trace configuration should be listed. Click on the Close button to close the Configuration dialog.
Use Project>Settings... to open the Project Settings dialog.
Select Win32 Trace in the Settings for: field.
Under the General tab, you can modify the Intermediate files and Output files directories to be just Trace instead of the long default directory name. This step is optional but recommended. Doing so will allow you to have a better organization of your project subdirectories: Debug, Release, and Trace.
In the General category under the Debug tab, you need to specify the full path of the SansGUI executable (SansGUI.exe in the bin subdirectory of the SansGUI installation directory) in the Executable for debug session: field and the directory where the testing Project Model resides in the Working directory: field.
Under the C/C++ tab, a few changes are needed: 1) in the General category, select Disable (Debug) for Optimization, 2) in the Debug Info: field, select Program Database, and 3) in the Code Generation category, make sure the field Use run-time library: field is set to Multithreaded, the default setting.
In the General category under the Link tab, check the Generate debug info option. Leave all other fields with their default settings.
Click on the OK button to close the dialog.
Now you have finished the new Win32 Trace configuration. Select the Build>Set active configuration... menu item to set the project to this mode.
Build the DLL by selecting Build>Build <DLL> or pressing the F7 key.
After you have successfully build the simulator DLL in Win32 Trace mode, you can go on to the next section, Running Simulation in Debugging Sessions.
Unlike those built with MSVC, the simulator DLLs built with CVF in the Debug mode will not conflict with the SansGUI program because the libraries used in Fortran are not used by SansGUI. Therefore, you do not need to create a separate Trace mode as in the MSVC DLL projects. The preparation steps are, thus, simpler:
Open the Project Settings dialog by selecting the Project>Settings... menu item.
In the General category under the Debug tab, you need to specify the full path of the SansGUI executable (SansGUI.exe in the bin subdirectory of the SansGUI installation directory) in the Executable for debug session: field and the directory where the testing Project Model resides in the Working directory: field.
Click on the OK button to close the dialog.
Select the Build>Set active configuration... menu item to set the project to the Win32 Debug mode.
Build the DLL by selecting Build>Build <DLL> or pressing the F7 key.
After you have successfully build the simulator DLL in Win32 Trace mode, you can go on to the next section, Running Simulation in Debugging Sessions.
SansGUI Modeling and Simulation Environment Version 1.2
Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.