Sun Studio 12: Debugging a Program With dbx

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.

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


$ dbx

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


$ dbx 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}

Sun 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. To start the 32-bit dbx on a 64-bit OS, use the dbx command with the -x exec32 option (see Options) or set the _DBX_EXEC_32 environment variable).


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.



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.