!for_each_register

The !for_each_register extension executes a specified command for each register.

!for_each_register -c:CommandString
!for_each_register -?

Parameters

-c:CommandString
Specifies the command to be executed for each register. The aliases @#RegisterName and @#RegisterValue are valid during the execution of the command.

-?
Displays help for the !for_each_register extension.

DLL

Ext.dll

Examples

This example lists the name of each register.

0:000> !for_each_register -c:.echo @#RegisterName
rax
rcx
rdx
rbx
...

This example executes !address for each register value.

0:000> !for_each_register -c:!address ${@#RegisterValue}
...
Usage:                  Stack
Base Address:           00000008`a568f000
End Address:            00000008`a56a0000
Region Size:            00000000`00011000
State:                  00001000    MEM_COMMIT
Protect:                00000004    PAGE_READWRITE
Type:                   00020000    MEM_PRIVATE
Allocation Base:        00000008`a5620000
Allocation Protect:     00000004    PAGE_READWRITE
More info:              ~0k
...

Remarks

When an alias is an argument to a debugger extension (for example, !address), use the alias interpreter ${} (Alias Interpreter) token so that the alias is resolved correctly.

For more information about how to define and use aliases as shortcuts for entering character strings (including use of the ${} token), see Using Aliases.