问题
Is there a way to iterate through all frames in windbg? (or to run dv for each stack frame)
For example: ~*e !mk -cc will iterate through all threads and call !mk -cc
What I want is basically:
For each thread: switch to thread:
~0s
For each frame in that thread:
.frame 00
dv
Just wondering if there is a way to automate this?
Currently I am able to generate a script to do:
~0s
.frame 00
dv
.frame 01
dv
.frame 02
...
But this is a multistep process, and I want to automate it all.
回答1:
You can use the ~e command to execute a command per-thread. Then you can use !for_each_frame to execute a command for each call frame. For example:
~*e .echo Thread Frames and Locals:; !for_each_frame dv
The .echo command is included simply to mark where one thread ends and the next begins.
来源:https://stackoverflow.com/questions/16340917/is-there-a-way-to-itereate-through-all-frames-in-windbg