Skip Navigation Links | |
Exit Print View | |
Oracle Solaris Studio 12.3: Debugging a Program With dbx Oracle Solaris Studio 12.3 Information Library |
4. Viewing and Navigating To Code
Selecting From a List of C++ Ambiguous Function Names
Choosing Among Multiple Occurrences
Walking the Call Stack to Navigate To Code
Variables That Reflect the Current Scope
Components of the Visiting Scope
Qualifying Symbols With Scope Resolution Operators
C++ Double Colon Scope Resolution Operator
Printing a List of Occurrences of a Symbol
Determining Which Symbol dbx Uses
Relaxing the Scope Lookup Rules
Viewing Variables, Members, Types, and Classes
Looking Up Definitions of Variables, Members, and Functions
Looking Up Definitions of Types and Classes
Debugging Information in Object Files and Executables
Listing Debugging Information for Modules
5. Controlling Program Execution
6. Setting Breakpoints and Traces
8. Evaluating and Displaying Data
11. Debugging Multithreaded Applications
16. Debugging Fortran Using dbx
17. Debugging a Java Application With dbx
18. Debugging at the Machine-Instruction Level
19. Using dbx With the Korn Shell
dbx must know the location of the source code files associated with a program. The default directory for the source files is the one they were in when last compiled. If you move the source files, or copy them to a new location, you must either relink the program, change to the new location before debugging, or use the pathmap command.
Under the stabs format used by dbx in Sun Studio 11 and earlier releases, debugging information in dbx sometimes uses object files to load additional debugging information. Source files are used when dbx displays source code.
Symbolic information, including paths to source files, is contained within the executable file. When dbx needs to display source lines, it reads as much symbolic information as necessary to locate the source file, and read and display the lines from it.
The symbolic information includes the full pathname of a source file, but when you type dbx commands, you typically use only the basename of a file. For example:
stop at test.cc:34
dbx searches for a matching file in the symbolic information.
If you have removed source files, dbx cannot show you source lines from those files, but you can display stack traces, print variable values, and even know what source line you are on.
If you have moved the source files since you compiled and linked the program, you can add their new location to the search path. The pathmap command creates a mapping from your current view of the file system to the name in the executable image. The mapping is applied to source paths and object file paths.
To establish a new mapping from the directory from to the directory to:
(dbx) pathmap [-c] from to
If -c is used, the mapping is applied to the current working directory as well.
The pathmap command is also useful for dealing with automounted and explicit NFS mounted file systems with different base paths on differing hosts. Use -c when you try to correct problems due to the automounter because current working directories are inaccurate on automounted file systems.
The mapping of /tmp_mnt to / exists by default.
For more information, see pathmap Command.