If you are talking about post mortem debugging on windows:
https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/enabling-postmortem-debuggingThere is no automatic way to set this up for codeblocks, you will have to set the registry entries by yourself. Also i don't think that starting the debugger from command line is at the moment possible. BUT: you can start gdb from the command line...
The same is true for cdb...
The problem here is: Codelbocks is made to debug in a loaded project (paths, files, debugger settings are stored in the project file) If you use post mortem debugging codeblocks does not know where the project is and so he can not load the needed information.... But i am not sure about all this, maybe someone has a solution for you...