WinDBG的命令类别?

KyL*_*KyL 4 debugging windbg wdk windows-kernel

我看到一些关于WinDBG的commnads的参考和教程.他们中的一些人喜欢这个lm,这个.echo,这个!running和这个nt!_PDB.

这些类别之间有什么区别

  • XXX
  • .XXX
  • !XXX
  • XXX!YYY

他们看起来很困惑.

Tho*_*ler 9

有内置命令,元命令(点命令)和扩展命令(爆炸命令).

我个人认为,与元命令相比,你不需要太在意内置命令的区别,因为有足够的例子说明这些定义不能正确匹配.知道他们总是在那里并且不需要加载扩展就足够了.

内置命令的好例子,主要是控制和从调试目标获取信息:

g - go
k - call stack
~ - list threads
Run Code Online (Sandbox Code Playgroud)

恕我直言,这个定义并不真正匹配的例子:

version    - show version of the debugger
vercommand - show command line that was used to start the debugger
n          - set number base
Run Code Online (Sandbox Code Playgroud)

元命令的好例子,它们被认为只影响调试器但不影响目标:

.cls        - clear screen
.chain      - display loaded extensions
.effmach    - change behavior of the debugger regarding the architecture
.prefer_dml - change output format
Run Code Online (Sandbox Code Playgroud)

恕我直言这个定义不匹配的例子:

.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)
Run Code Online (Sandbox Code Playgroud)

然而,这是很好的了解,扩展命令是不同的,特别是因为可能导致不同的输出相同的命令,这取决于哪些扩展加载或首次出现在扩展列表,你可以影响的顺序(如通过.load,.unload,.setdll) .除了简单的表单!command,请注意还有!extension.command明确指定扩展名的语法.我将在下面的例子中使用它.(甚至有!c:\path\to\extension.command)

扩展命令冲突的示例是从内核调试会话中给出的,其中一个!heap不提供任何输出,另一个显然需要一个参数才能工作.

0: kd> !ext.heap
0: kd> !exts.heap
Invalid type information
Run Code Online (Sandbox Code Playgroud)

你的问题(xxx!yyy)中提到的最后一种格式不是命令,而是一种方法或类型信息,其中xxx表示模块(DLL),yyy表示方法或类型名称.通常,这也会出现方法内部位置的额外偏移量(xxx!yyy+0xhhh)