Sun Studio 12: Debugging a Program With dbx

step Command

The step command steps one source line or statement (stepping into calls that were compiled with the -g option).

The dbx step_events environment variable controls whether breakpoints are enabled during a step.

The dbx step_granularity environment variable controls granularity of source linestepping.

The dbx step_abflow environment variable controls whether dbx stops when it detects that "abnormal" control flow change is about to occur. Such control flow change can be caused by a call to siglongjmp() or longjmp() or an exception throw.

Native Mode Syntax

step

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, helping to avoid long sequences of step commands and step up commands. Examples of the last function are:

f()->s()-t()->last();

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

where:

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 assemble 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.

Java Mode Syntax

step

Single step one line (step into calls). With multithreaded programs when a method call is stepped over, all threads are implicitly resumed for the duration of that method 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 method.

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 method.