### Debugger Cannot Find Source Code

In the Source window, you may not be able to obtain a source view of an object, even though the code was compiled with debug information, if the debugger cannot find the source files for it. When you start debugging such a program, or when execution lands in a part of the program that was compiled with debug information but the debugger cannot find the source code for it, the debugger normally opens a Source Filename dialog in which you can enter the location and name of the source file. If you choose Cancel when this dialog appears, the debugger displays a disassembly view of the code, because it has no source code to display. If the source file has been moved or renamed, select View->Change text file, and enter the correct path and name in the Change text file dialog. (The debugger searches the workstation for source files using a search path based on environment variables, which you can set before starting your debug session. If you anticipate frequently having your source files in a different directory from your executables, you should set these environment variables.)

If you are debugging remotely, the debugger searches for the files in the path you specify, first on the workstation where the program being debugged is running, then on the workstation where the debugger user interface is running.

Environment Variables