| |||
| Home > Customizing Projects > Working with source files > Specifying source search paths | |||
By default RealView Debugger searches for application source file paths according to information contained in the image. If no paths are provided in the image file, RealView Debugger uses the list of directories specified in the project settings. If this fails, or where no search path has been specified, RealView Debugger looks in the current working directory for the source file or files.
In the following example, the project and the image that it builds have been created in one directory and then moved to another location for debugging. This means that RealView Debugger cannot locate source files:
Ensure that the Project Properties window is not open. When searching for source files, RealView Debugger updates the project properties as necessary. This fails if the window is already open.
Close any files that are open in the File Editor so that they are not found, and included, in the search mechanism.
Select Project ? Open Project... and open the
project, for example dhrystone.prj.
Connect to your target and load the associated image,
for example dhrystone.axf.
RealView Debugger loads the image but cannot locate a source file and so displays the source search prompt, shown in Figure 6.2.
If you close the prompt, for example by clicking Cancel, RealView Debugger warns you that it cannot locate source files for the new image. The project properties are unchanged.
You can use the source search prompt to change the search rules that RealView Debugger uses. There are two ways to do this:
Use the source search prompt, shown in Figure 6.2, to autoconfigure the search rules:
Either:
Edit the pathname shown in the prompt.
Click the directory button to locate the required file.
Click Retry.
If RealView Debugger fails to locate the file, the source search prompt remains for you to try again. If RealView Debugger succeeds, the source search prompt closes automatically.
If the required file is already listed when you click the directory button, select it to update the project properties. The source search prompt then closes automatically.
Pathnames that you add this way automatically update the project
properties for the active project. Where your project is an in-memory
auto-project, RealView Debugger also saves the project settings file, for
example dhrystone.axf.apr.
Select Project ? Project Properties... to display the Project Properties window where you can see the new search rules. shown in the example in Figure 6.3.
As shown in Figure 6.3, absolute pathnames are used to define the new search rules. However, if you modify the source search path yourself, pathnames become relative (see Manually configuring search rules for details).
For more details on other entries in this window see Source path mappings.
If you have an open project, you can specify search paths using the Project Properties window. Any search that you define is then saved with the project settings and additionally used to locate source files.
To configure the search rules manually:
Select Project ? Project Properties... to display the Project Properties window, shown in Figure 6.4.
For more details on other entries in this window see Source path mappings.
Right-click on Source_search and
use Edit as Directory Name... to specify
the new location, shown in Figure 6.4.
Click File ? Save and Close to confirm your choice and close the Project Properties window.
Do not leave the Project Properties window open when you are working with the debugger. When searching for source files, RealView Debugger changes the project properties as necessary. This fails if the window is already open.
As shown in Figure 6.5, relative pathnames are used to define the new search rules when you configure them in this way. If you modify an autoconfigured source search path, absolute pathnames become relative.