Sun Studio 12 Update 1: Debugging a Program With dbx

Attaching to Child Processes

You can attach to a running child process in one of the following ways.


$ dbx program_name process_id

(dbx) debug program_name process_id

You can substitute program_name with the name - (minus sign), so that dbx automatically finds the executable associated with the given process ID (process_id). After using a -, a subsequent run command or rerun command does not work because dbx does not know the full path name of the executable.

You can also attach to a running child process in the Sun Studio IDE (see “Attaching the Debugger to a Running Process” in the IDE online help) or dbxtool (see “Attaching dbxtool to a Running Process” in the dbxtool online help).