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
5. Controlling Program Execution
Attaching dbx to a Running Process
Continuing Execution of a Program
To Resume Program Execution at a Specific Line
Using Ctrl+C to Stop a Process
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
When you first load a program into dbx, dbx navigates to the program’s “main” block (main for C, C++, and Fortran 90; MAIN for Fortran 77; the main class for Java code). dbx waits for you to issue further commands; you can navigate through code or use event management commands.
You can set breakpoints in the program before running it.
Note - When debugging an application that is a mixture of Java code and C JNI (Java Native Interface) code or C++ JNI code, you may want to set breakpoints in code that has not yet been loaded. For information on setting breakpoints on such code, see Setting Breakpoints in Native (JNI) Code .
Use the run command to start program execution.
To run a program in dbx without arguments, type:
(dbx) run
You can optionally add command-line arguments and redirection of input and output.
(dbx) run [arguments][ < input_file] [ > output_file]
Note - You cannot redirect the input and output of a Java application.
Output from the run command overwrites an existing file even if you have set noclobber for the shell in which you are running dbx.
The run command without arguments restarts the program using the previous arguments and redirection. For more information, see run Command. The rerun command restarts the program and clears the original arguments and redirection. For more information, see rerun Command.