Go to main content
Oracle® Developer Studio 12.6: Debugging a Program with dbx

Exit Print View

Updated: June 2017
 
 

Using the pathmap Command to Improve Skimming

If you move your source files after compiling, build on one machine and debug on another, or are in one of the other situations described in Finding Source and Object Files, macro skimming might not be able to find include files in the file it is skimming. The solution, as with other cases of files not being found, is to use the pathmap command to help the macro skimmer locate include directories. Imagine, for example, that you compile with the option –I/export/home/proj1/include and have the statement #include "module1/api.h" in your code. Then, if you rename proj1 to proj2, the following pathmap command will help the macro skimmer locate your files:

pathmap /export/home/proj1 /export/home/proj2

The pathmap is not applied to the compilers used to compile the original code.

When you are working with macros, you must reload your application in order to have pathmaps take effect, unlike other situations when a file is not found and you can use the pathmap command to make changes in a pathmapping that are immediately effective.

The pathmap command helps dbx find the correct files when you build on one machine and debug on another. However, system include files such as /usr/include/stdio.h are typically not exported from the build machine, so the macro skimmer is likely to use the files on the debug machine. In some cases, a system include file might not be available on the debug machine. The value of system-specific and system-dependent macros also might not be the same on the debug machine as on the build machine.

If the pathmap command does not solve your skimming problems, consider compiling your code with the –g3 option and setting the macro_source dbxenv variable to skim_unless_compiler or compiler.