Debugging 类似于;直至;像GDB中针对WinDbg的命令,还是WinDbg中离开循环的简单方法?
目前我按鼠标右键选择Debugging 类似于;直至;像GDB中针对WinDbg的命令,还是WinDbg中离开循环的简单方法?,debugging,windbg,Debugging,Windbg,目前我按鼠标右键选择“将文件路径复制到剪贴板”菜单。下一步左键单击源代码行,直到执行代码的位置,外部循环(该行号在WinDbg的右下角指示) 接下来在命令提示符中,我设置了断点(通过从剪贴板插入文件路径并键入从状态栏读取的行号): bp`d:\home\devel\plugin\plugin svn\common\win gui admin.c:788` 这似乎太复杂了。在GDB中,将循环重新保存的命令保留到。在WinDbg中有什么方法可以做到这一点吗?F7为您提供了“运行到光标”命令,我认为它
“将文件路径复制到剪贴板”
菜单。下一步左键单击源代码行,直到执行代码的位置,外部循环(该行号在WinDbg的右下角指示)
接下来在命令提示符中,我设置了断点(通过从剪贴板插入文件路径并键入从状态栏读取的行号):
bp`d:\home\devel\plugin\plugin svn\common\win gui admin.c:788`
这似乎太复杂了。在GDB中,将循环重新保存的命令保留到
。在WinDbg中有什么方法可以做到这一点吗?F7为您提供了“运行到光标”命令,我认为它可以满足您的需要。只要把光标放在你想要的任何源代码行上,然后点击F7
-scottF7为您提供了“运行到光标”命令,我认为它符合您的要求。只要把光标放在你想要的任何源代码行上,然后点击F7
-scott再次给出了一个很晚的答案,但可以在windbg中使用源代码级语法
.lines
以启用src线路支持l+*
启用所有src选项lsf
加载src文件ls from,to
检查当前src文件中的src行lsc
显示当前src文件`模块!srcfile:linenum`
删除任何src文件中的任何行(src语法需要用严重的重音符号而不是单引号括起来)
下面是一个示例演练
jmpouttaloo:\>dir /b
jmpouttaloo.cpp
jmpouttaloo:\>type jmpouttaloo.cpp
#include <stdio.h>
int main (void)
{
int i=0,j=0,k=0,l=0;
while (i++ < 100)
{
while (j++ < 100)
{
while(k++ < 100)
{
l++;
}
l++;
}
l++;
}
printf("%d\n",l);
return 0;
}
jmpouttaloo:\>cl /Zi /nologo jmpouttaloo.cpp
jmpouttaloo.cpp
jmpouttaloo:\>dir /b *.exe
jmpouttaloo.exe
jmpouttaloo:\>jmpouttaloo.exe
300
p步进,每个步进一条src线在6个步骤中,我们在最里面的while循环中着陆
现在我们要系统地摆脱每个循环
ls start,count
显示从开始编号到开始编号+计数的src行
直到我们到达特定的src线
do g graveaccent冒号graveaccent
完整的src行语法如下
graveaccent modulename! filename : linenumber graveaccent
首轮
0:000> cdb: Reading initial command '.lines;l+*; lsf jmpouttaloo.cpp; bp jmpouttaloo!main;g'
Breakpoint 0 hit
> 3: {
0:000> p
> 4: int i=0,j=0,k=0,l=0;
0:000>
> 5: while (i++ < 100)
0:000>
> 7: while (j++ < 100)
0:000>
> 9: while(k++ < 100)
0:000>
> 11: l++;
0:000>
> 12: }
0:000>
> 9: while(k++ < 100)
这也是一个非常晚的答案,但可以在windbg中使用源代码级语法
.lines
以启用src线路支持l+*
启用所有src选项lsf
加载src文件ls from,to
检查当前src文件中的src行lsc
显示当前src文件`模块!srcfile:linenum`
删除任何src文件中的任何行(src语法需要用严重的重音符号而不是单引号括起来)
下面是一个示例演练
jmpouttaloo:\>dir /b
jmpouttaloo.cpp
jmpouttaloo:\>type jmpouttaloo.cpp
#include <stdio.h>
int main (void)
{
int i=0,j=0,k=0,l=0;
while (i++ < 100)
{
while (j++ < 100)
{
while(k++ < 100)
{
l++;
}
l++;
}
l++;
}
printf("%d\n",l);
return 0;
}
jmpouttaloo:\>cl /Zi /nologo jmpouttaloo.cpp
jmpouttaloo.cpp
jmpouttaloo:\>dir /b *.exe
jmpouttaloo.exe
jmpouttaloo:\>jmpouttaloo.exe
300
p步进,每个步进一条src线在6个步骤中,我们在最里面的while循环中着陆
现在我们要系统地摆脱每个循环
ls start,count
显示从开始编号到开始编号+计数的src行
直到我们到达特定的src线
do g graveaccent冒号graveaccent
完整的src行语法如下
graveaccent modulename! filename : linenumber graveaccent
首轮
0:000> cdb: Reading initial command '.lines;l+*; lsf jmpouttaloo.cpp; bp jmpouttaloo!main;g'
Breakpoint 0 hit
> 3: {
0:000> p
> 4: int i=0,j=0,k=0,l=0;
0:000>
> 5: while (i++ < 100)
0:000>
> 7: while (j++ < 100)
0:000>
> 9: while(k++ < 100)
0:000>
> 11: l++;
0:000>
> 12: }
0:000>
> 9: while(k++ < 100)
谢谢我曾经使用WinDbg,但没有看到“运行到光标”按钮(F7或Ctrl+F10)。谢谢!我使用WinDbg一段时间,没有观察到“运行到光标”按钮(F7或Ctrl+F10)。感谢大家对这个问题感兴趣+1感谢您的提问+1.
another jig this time we break on line 15 straight without even loading the src
jmpouttaloo:\>cdb -c ".lines;g `jmpouttaloo!jmpouttaloo.cpp:15`;dv;q" jmpouttaloo.exe | grep -A 4 "j ="
j = 0n101
l = 0n200
k = 0n200
i = 0n1
quit:
jmpouttaloo:\>