Is there a way to itereate through all frames in windbg?

混江龙づ霸主 提交于 2019-12-10 11:49:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!