One of the easiest ways to ensure that the debugger can locate the source for your C/C++ program is to compile it with the -qfullpath compiler option. For more information about debug compiler options, see the related topic.
When the debugger cannot find source, the debugger editor opens without source - however, right inside the editor, you are provided with options for locating the source. One of these options, the Edit Source Lookup push button, opens the Edit Source Lookup Path dialog in which you can select the type of source location to add. Alternatively, you can alter the source location list by right-clicking on a stack frame or thread in the Debug view and selecting the Edit Source Lookup action.
After you have launched a debug session, you can modify or add to the source location list by completing these steps:
If your program was not compiled with -qfullpath, your source has moved, or you are debugging on a system other than the one on which your program was built, the debugger may locate the incorrect source for the current stack frame. When this happens, you can change the text file that opens in the editor by completing the following steps:
When source cannot be found, the editor opens without source. In the editor, you are provided with these options: