Sun Studio 12 Update 1: Debugging a Program With dbx

Native Mode Syntax


Single step one line (step into calls). With multithreaded programs when a function call is stepped over, all threads are implicitly resumed for the duration of that function call in order to avoid deadlock. Non-active threads cannot be stepped.

step n

Single step n lines (step into calls).

step up

Step up and out of the current function.

step ... -sig signal

Deliver the given signal while stepping. If a signal handler exists for the signal, step into it if the signal handler was compiled with the -g option.

step ...thread_id

Step the given thread. Does not apply to step up.

step ...lwp_id

Step the given LWP. Does not implicitly resume all LWPs when stepping over a function.

step to [ function ]

Attempts to step into function called from the current source code line. If function is not given, steps into the last function called, helping to avoid long sequences of step commands and step up commands. Examples of the last function are:


last(a() + b(c()->d()));


n is the number of lines to step.

signal is the name of a signal.

thread_id is a thread ID.

lwp_id is an LWP ID.

function is a function name.

Only when an explicit lwp_id is given, the deadlock avoidance measure of the generic step command is defeated.

When executing the step tocommand, while an attempt is made to step into the last assembly call instruction or step into a function (if specified) in the current source code line, the call may not be taken due to a conditional branch. In a case where the call is not taken or there is no function call in the current source code line, the step to command steps over the current source code line. Take special consideration on user-defined operators when using the step to command.

See also stepi Command for machine-level stepping.