Muokkaa

Jaa


t (Trace)

The t 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, each of their steps is also traced.

User-Mode

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

Kernel-Mode

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

Parameters

Thread
Specifies threads to thaw. All other threads are frozen. For more information about this 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 trace 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 trace is performed. This command is executed before the standard t results are displayed. If you also use Count, this command is executed after all tracing is complete (but before the results from the final trace are displayed).

Environment

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

Additional Information

For more information about how to issue the t 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.

Each trace 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.

If you want to trace most function calls but skip certain calls, you can use .step_filter (Set Step Filter) to indicate which calls to step over.

You can use the t command to trace instructions in ROM.

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