Windbg 如何在不删除所有断点的情况下重新启动调试对象?

Windbg 如何在不删除所有断点的情况下重新启动调试对象?,windbg,Windbg,每次我执行.restart(因为我不小心按了太多次F10),WinDBG都会删除我的所有断点。重新启动调试对象时,是否可以让其保留断点?如果使用bu而不是bp断点设置断点,则断点保存在工作区中。所以,这样做,保存工作区,这应该是技巧。这需要awk路径,我通常在我的设置中有 如果是windbg、cdb或kd,则会起作用。不必记得对问题总是说“是”或“否” 0:000> .shell -ci "bl" awk "{print \"bp \" $7}" >> c:\breaks.tx

每次我执行
.restart
(因为我不小心按了太多次F10),WinDBG都会删除我的所有断点。重新启动调试对象时,是否可以让其保留断点?

如果使用
bu
而不是
bp
断点设置断点,则断点保存在工作区中。所以,这样做,保存工作区,这应该是技巧。

这需要awk路径,我通常在我的设置中有

如果是windbg、cdb或kd,则会起作用。不必记得对问题总是说“是”或“否”

0:000> .shell -ci "bl" awk "{print \"bp \" $7}" >> c:\breaks.txt
.shell: Process exited

0:000> .restart
CommandLine: C:\Windows\System32\calc.exe

774e04f6 cc              int     3
0:000> bl

0:000> $$>a< c:\breaks.txt

0:000> bl
 0 e 00fb1635     0001 (0001)  0:**** calc!WinMain
 1 e 75eaea11     0001 (0001)  0:**** USER32!MessageBoxA
 2 e 774855c8     0001 (0001)  0:**** ntdll!NtCreateFile
编辑

我刚刚检查了clickety历史记录不是命令历史记录的一部分,也没有按下
f9键
在windbg中单击手形图标
提供历史记录事件

0:000> bl
 0 e 00a11022     0001 (0001)  0:**** helloworld!main+0x22
 1 e 00a11016     0001 (0001)  0:**** helloworld!main+0x16
0:000> .bpcmds
bu0 @@masm(`helloworld!c:\test\helloworld\helloworld.cpp:6+`);
bu1 @@masm(`helloworld!c:\test\helloworld\helloworld.cpp:5+`);
windbg> .write_cmd_hist c:\foo.txt
Wrote command history to 'c:\foo.txt'
0:000> .shell - type c:\foo.txt
Unknown option ' '
.write_cmd_hist c:\foo.txt
.bpcmds
bl
.cls
t <----- neither f8 ,f10 nor f5 gets recorded in the history
.echo foo
g helloworld!main
.shell: Process exited
Press ENTER to continue
<.shell waiting 1 second(s) for process>
<.shell process may need input>
0:000>bl
0 e 00a11022 0001(0001)0:***你好!main+0x22
1 e 00a11016 0001(0001)0:***你好!main+0x16
0:000>.bpcmds
bu0@@masm(`helloworld!c:\test\helloworld\helloworld.cpp:6+`);
bu1@@masm(`helloworld!c:\test\helloworld\helloworld.cpp:5+`);
windbg>.write\u cmd\u hist c:\foo.txt
已将命令历史记录写入“c:\foo.txt”
0:000>.shell-键入c:\foo.txt
未知选项“”
.write_cmd_hist c:\foo.txt
.bpcmds
基本法
.cls

不保存工作区?它存储断点吗?它保存
bu
断点,但不保存
bp
断点,因此解决方案是使用
bu
并保存工作区。我甚至不知道工作区是什么:)请看这里:这篇经典文章:我通过单击源代码行来创建断点。这是使用bu还是bp?这些是未解决的断点(
bu
)。请参见此处(最后一段):您可以使用显示用于设置当前断点的命令的
.bpcmds
来验证这一点。
.write\u cmd\u hist
是否对通过单击源代码行设置的断点执行任何操作?我没有输入任何命令来设置这些断点,我只是单击相应的源代码行。似乎不是这样,那么远程调试呢
.shell
在目标计算机上运行。我们是否需要在所有调试的机器上安装
awk
?WinDbg中有一个内置解决方案。试图重新发明车轮只是为了重新发明似乎。。。不必要的。
0:000> bl
 0 e 00a11022     0001 (0001)  0:**** helloworld!main+0x22
 1 e 00a11016     0001 (0001)  0:**** helloworld!main+0x16
0:000> .bpcmds
bu0 @@masm(`helloworld!c:\test\helloworld\helloworld.cpp:6+`);
bu1 @@masm(`helloworld!c:\test\helloworld\helloworld.cpp:5+`);
windbg> .write_cmd_hist c:\foo.txt
Wrote command history to 'c:\foo.txt'
0:000> .shell - type c:\foo.txt
Unknown option ' '
.write_cmd_hist c:\foo.txt
.bpcmds
bl
.cls
t <----- neither f8 ,f10 nor f5 gets recorded in the history
.echo foo
g helloworld!main
.shell: Process exited
Press ENTER to continue
<.shell waiting 1 second(s) for process>
<.shell process may need input>