Each time I do a .restart
(because I accidentally pressed F10 one too many times), WinDBG erases all my breakpoints. Is it possible to have it leave the breakpoints in place when restarting the debuggee?
If you set breakpoints using bu
rather than with bp
breakpoints they are saved in the workspace. So do that, save the workspace, and that should to the trick.
this requires awk in path which i normally have in my setup
will work if it is windbg cdb or kd dont have to remember saying yes no always to questions
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
also if there is no aslr saving the command history can help you restart the session in its full glory
.write_cmd_hist c:\foo.txt
edit
i just checked the clickety history is not part of the command history neither f9 key
press nor clicking the hand icon
in windbg provides a history event
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With