Rediger

Del via


p (Step)

The p command executes a single instruction or source line and optionally displays the resulting values of all registers and flags. When subroutine calls or interrupts occur, they are treated as a single step.

User-Mode

[~Thread] p[r] [= StartAddress] [Count] ["Command"] 

Kernel-Mode

p[r] [= StartAddress] [Count] ["Command"] 

Parameters

Thread
Specifies the threads to continue executing. All other threads are frozen. For more information about the syntax, see Thread Syntax. You can specify threads only in user mode.

r
Turns on and off the display of registers and flags. By default, the registers and flags are displayed. You can disable register display by using the pr, tr, or .prompt_allow -reg commands. All three of these commands control the same setting and you can use any of them to override any previous use of these commands.

You can also disable register display by using the l-os command. This setting is separate from the other three commands. To control which registers and flags are displayed, use the rm (Register Mask) command.

StartAddress
Specifies the address where execution should begin. If you do not use StartAddress, execution begins at the instruction that the instruction pointer points to. For more information about the syntax, see Address and Address Range Syntax.

Count
Specifies the number of instructions or source lines to step through before stopping. Each step is displayed as a separate action in the Debugger Command window. The default value is one.

Command
Specifies a debugger command to execute after the step is performed. This command is executed before the standard p results are displayed. If you also use Count, the specified command is executed after all stepping is complete (but before the results from the final step are displayed).

Environment

Item Description
Modes user mode, kernel mode
Targets live debugging only
Platforms all

Additional Information

For more information about issuing the p command and an overview of related commands, see Controlling the Target.

Remarks

When you specify Count, each instruction is displayed as it is stepped through.

If the debugger encounters a call instruction or interrupt while stepping, the called subroutine will execute completely unless a breakpoint is encountered. Control is returned to the debugger at the next instruction after the call or interrupt.

Each step executes a single assembly instruction or a single source line, depending on whether the debugger is in assembly mode or source mode. Use the l+t and l-t commands or the buttons on the WinDbg toolbar to switch between these modes.

When you are quickly stepping many times in WinDbg, the debugging information windows are updated after each step. If this update causes slower response time, use .suspend_ui (Suspend WinDbg Interface) to temporarily suspend the refreshing of these windows.