Windbg学习笔记:源码模式调试

源语言要求:C, C++, or assembly.

#1 编译要求

符号文件(.pdb files)   ---- visual studio 2012默认生成
源代码
打开编译器开关 /Od  /Oi


 #2 定位符号文件和源代码文件

#3 单步源码调试的范例
.lines        enable source line information
bp main    set initial breakpoint
l+t           stepping will be done by source line
l+s           source lines will be displayed at prompt
g             run program until "main" is entered
pr            execute one source line, and toggle register display off
p             execute one source line

#4 设置特定行源码断点
? `[[module!]filename][:linenumber]`
此命令显示模块源码文件某行的地址,注意:里面的符号不是靠近回车键的逗号,而是ESC键下面的键。图中的第二行是逗号,第一行是正确写法。

下图是成功设置断点后的截图。



 

posted @ 2012-09-19 20:45  simcity  阅读(3378)  评论(0编辑  收藏  举报