Preparing Your Program for Debugging
This section describes preparing your program for debugging:
To prepare your program for
debugging when using the visual development environment:
- Start the visual development environment (click Developer Studio in the Compaq Visual Fortran
program folder).
- Open the appropriate Workspace (File menu, either Open Workspaces or Recent Workspaces).
- Click the FileView pane.
- To edit the source file to be debugged, double-click on the file name.
- Click the Project name. The screen might appear as follows (the ClassView tab only appears
if Visual C++ is also installed):
![visual development environment after opening a workspace and fortran source file](db-orig-ide.gif)
- In the Build menu, click Set Active Configuration and select the debug configuration.
- To check your project settings for compiling and linking, in the Project menu, click Settings, then click the
Fortran tab. Similarly, to check the debug options set for your program (such as program arguments or
working directory), click the Debug tab in the Project Settings dialog box.
- To compile your program:
- Click (select) the source file to be compiled
- In the Build menu, click Compile filename
- Eliminate any compiler diagnostic messages in the text editor and recompile if needed.
- To build your application, in the Build menu, click Build file.EXE.
- Set breakpoints in the source file and debug the program, as described in
Debugging the Squares Example Program.
To prepare your program for
debugging when using the command line (DF command):
- Correct any compilation and linker errors.
- In a command window (such as the Fortran command window available
from the Visual Fortran program folder), compile and link the program
with full debug information and no optimization:
DF /debug:full /nooptimize file.f90
- Start the visual development environment.
- In the File menu, click the Open Workspace item. Specify the file name of the
executable (.EXE) file to be debugged.
- In the File menu, click Open. Specify the name of the source file (such as .F90 or .FOR)
that corresponds to the file being debugged. The text editor window appears. Your screen might
appear as follows:
- Set breakpoints in the source file and debug the program, as described in
Debugging the Squares Example Program.
To add Source Browser Information to your debug configuration, see
Source Browser Information for a Configuration.