My goal is to keep breakpoints between debugging sessions in CDB (the command line version of windbg). I am able to correctly restart by using .restart
, however I always lose my breakpoints (I am setting my breakpoints by using the bu
and/or bm
commands.
Is it even possible when using just cdb?
cdb is not possible use .bpcmds before .restart and save to someplace and reuse it after restart
for windbg you can use workspaces to save breakpoints between sessions
edit a demo
suppose you have these breakpoints
.bpcmds will show you how set them (the last two are symbol less bps based on rva )
and if you had set them using bp they may not work the next time
due to ASLR as the module may be loaded at a different Address
copy paste to some scratch space and after .restart copy paste back to cdb console
you can use .logopen {some_path_to_some_textfile} do .bpcmds and .restart also
in this case you can copy paste the bps from logfile and don't have to open the log file again as windbg/cdb doesn't close the logfile on .restart
here is .restart also capturted to logfile