WinDBG Preview 版脚本

WinDBG Preview 支持用 JS 来写脚本。

之前弄过一套,虽然不能自动化调试,但是看信息,看数据什么的挺方便,

但是,脚本不见了。。。也没保存,也没入库。。。这里赶快保存一下。

 

没啥用的脚本,但是没准哪天用到了,还能想一想。

查看所有线程的调用栈信息。

确实就没啥用。

 

复制代码
 1 "use strict";
 2 
 3 function initializeScript()
 4 {
 5     host.diagnostics.debugLog("***> initializeScript\n");
 6     return [new host.apiVersionSupport(1, 7)];
 7 }
 8 
 9 function RunCommands(cmd)
10 {
11     var ctl = host.namespace.Debugger.Utility.Control;   
12     var output = ctl.ExecuteCommand(cmd);
13     host.diagnostics.debugLog("run> [" + cmd + "]\n");
14     for (var line of output)
15     {
16         host.diagnostics.debugLog("     ", line, "\n");
17     }
18     host.diagnostics.debugLog("\n");
19 }
20 
21 function invokeScript()
22 {
23     //
24     // Insert your script content here.  This method will be called whenever the script is
25     // invoked from a client.
26     //
27     // See the following for more details:
28     //
29     //     https://aka.ms/JsDbgExt
30     //
31     host.diagnostics.debugLog("***> invokeScript\n");
32 
33     var ctl = host.namespace.Debugger.Utility.Control;
34     for (var i=0;i<=28;i++)
35     {
36         var cmd = "~" + i.toString() + "s" + "; kv";
37         RunCommands(cmd);
38     }
39 }
复制代码

 

posted @   穷到底  阅读(192)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
历史上的今天:
2016-09-01 minifilter 算是总结吧
2016-09-01 Minifilter 相关
点击右上角即可分享
微信分享提示