我看到一些关于WinDBG的commnads的参考和教程。
其中一些人喜欢这个lm
,此.echo
,此!running
和此nt!_PDB
。
这些类别之间有什么区别
他们看起来很困惑。
答案 0 :(得分:9)
有内置命令,元命令(点命令)和扩展命令(爆炸命令)。
我个人认为,与元命令相比,你不必过多关注内置命令的区别,因为有足够的例子说明这些定义不能正确匹配。知道他们总是在那里并且不需要加载扩展就足够了。
内置命令的好例子,主要是控制和从调试目标获取信息:
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
)
答案 1 :(得分:2)
请参阅以下内容:
xxx - these are built in commands
.xxx - these are meta commands
!xxx - these are extension commands, so they call a command from an extension dll
xxx!yyy - this looks the syntax to reference an exported function from a dll:
<dll_name>!<method_name>
您可能会发现以下内容有用:http://windbg.info/doc/1-common-cmds.html