有内置命令、元命令(点命令)和扩展命令(bang命令)。
我个人的看法是,您不必太在意内置命令与元命令相比的差异,因为这些定义不正确匹配的例子已经足够多了。知道它们始终存在并且不需要加载扩展程序就足够了。
内置命令的好例子,主要是关于控制和从调试目标获取信息:
g - go
k - call stack
~ - list threads
恕我直言,此定义不真正匹配的示例:
version - show version of the debugger
vercommand - show command line that was used to start the debugger
n - set number base
元命令的好例子,被认为只影响调试器而不影响目标:
.cls - clear screen
.chain - display loaded extensions
.effmach - change behavior of the debugger regarding the architecture
.prefer_dml - change output format
恕我直言,此定义不真正匹配的示例:
.lastevent - show last exception or event that occurred (in the target)
.ttime - display thread times (of the target)
.call - call a function (in the target)
.dvalloc - allocate memory (in the target)
但是,最好理解扩展命令是不同的,特别是因为相同的命令可能会导致不同的输出,这取决于加载的扩展或出现在扩展列表中的第一个扩展,并且您可以影响顺序(例如,通过.load、.unload、.setdll)。除了简单的!command 形式外,请注意,还有!extension.command 语法可以显式指定扩展名。我将在下面的示例中使用它。 (甚至还有!c:\path\to\extension.command)
扩展命令冲突的示例来自内核调试会话,其中一个!heap 没有给出任何输出,而另一个显然需要一个参数才能工作。
0: kd> !ext.heap
0: kd> !exts.heap
Invalid type information
您的问题中提到的最后一种格式(xxx!yyy)不是命令,而是方法或类型信息,其中 xxx 表示模块(DLL),yyy 表示方法或类型名称。通常,这也可以通过方法内部位置的额外字节偏移量看到 (xxx!yyy+0xhhh)