JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris Studio 12.3: Debugging a Program With dbx     Oracle Solaris Studio 12.3 Information Library
search filter icon
search icon

Document Information

Preface

1.  Getting Started With dbx

2.  Starting dbx

Starting a Debugging Session

Debugging a Core File

Debugging a Core File in the Same Operating Environment

If Your Core File Is Truncated

Debugging a Mismatched Core File

Eliminating Shared Library Problems

Things to Remember

Using the Process ID

The dbx Startup Sequence

Setting Startup Properties

Mapping the Compile-time Directory to the Debug-time Directory

Setting dbx Environment Variables

Creating Your Own dbx Commands

Compiling a Program for Debugging

Compiling with the -g Option

Using a Separate Debug File

Creating a Separate Debug File

Debugging Optimized Code

Parameters and Variables

Inlined Functions

Code Compiled Without the -g Option

Shared Libraries Require the -g Option for Full dbx Support

Completely Stripped Programs

Quitting Debugging

Stopping a Process Execution

Detaching a Process From dbx

Killing a Program Without Terminating the Session

Saving and Restoring a Debugging Run

Using the save Command

Saving a Series of Debugging Runs as Checkpoints

Restoring a Saved Run

Saving and Restoring Using replay

3.  Customizing dbx

4.  Viewing and Navigating To Code

5.  Controlling Program Execution

6.  Setting Breakpoints and Traces

7.  Using the Call Stack

8.  Evaluating and Displaying Data

9.  Using Runtime Checking

10.  Fixing and Continuing

11.  Debugging Multithreaded Applications

12.  Debugging Child Processes

13.  Debugging OpenMP Programs

14.  Working With Signals

15.  Debugging C++ With dbx

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

20.  Debugging Shared Libraries

A.  Modifying a Program State

B.  Event Management

C.  Macros

D.  Command Reference

Index

Starting a Debugging Session

How you start dbx depends on what you are debugging, where you are, what you need dbx to do, how familiar you are with dbx, and whether or not you have set up any dbx environment variables.

You can use dbx entirely from the command line in a terminal window, or run dbxtool, a graphical user interface for dbx. For information on dbxtool, see the dbxtool man page and the online help in dbxtool.

The simplest way to start a dbx session is to type the dbx command or dbxtool command at a shell prompt.

$ dbx

or

$ dbxtool

To start dbx from a shell and load a program to be debugged, type:

$ dbx program_name

or

$ dbxtool program_name

To start dbx and load a program that is a mixture of Java code and C JNI code or C++ JNI code:

$ dbx program_name{.class | .jar}

Oracle Solaris Studio software includes two dbx binaries, a 32-bit dbx that can debug 32-bit programs only, and a 64-bit dbx that can debug both 32-bit and 64-bit programs. When you start dbx, it determines which of its binaries to execute. On 64-bit operating systems, the 64-bit dbx is the default.


Note - On the Linux OS, the 64-bit dbx cannot debug 32-bit programs. To debug a 32-bit program on the Linux OS, you must start the 32-bit dbx with the dbx command option -xexec32 or set the DBX_EXEC_32 environment variable.



Note - When using the 32-bit dbx on a 64-bit Linux OS, do not use the debug command or set the follow_fork_mode environment variable to child if the result will be execution of a 64-bit program. Exit dbx and start the 64-bit dbx to debug a 64-bit program.


For more information on the dbx command and start-up options, see dbx Command and the dbx(1) man page.