3 ms·
I assume that this will only work if you've executed the program inside of GDB, not if you load a core file that was dumped earlier outside of GDB?
by nathanb 17y ago
I assume that this will only work if you've executed the program inside of GDB, not if you load a core file that was dumped earlier outside of GDB?
- varjag 17y agoGiven that it has to record state changes somehow, that makes sense.
- msnyder 17y agoIn fact, gdb can record the state changes and then store them into an "enhanced" core file, which can then later be used to debug the program in reverse. It's rather like adding a "time" dimension to your core file. ;-)
- yan 17y agoThinking about it, that would be the ultimate hack. If the core file does indeed have all the regions mapped when the core was dumped, you can theoretically load them as before then back-step each instruction since they are fairly well defined. The huge issue here is, the most probable reason for segfaulting was an unexpected value coming from the environment and it's impossible to know the environment the process was running in post-mortem.
- lallysingh 17y agoLots of state is lost! Like the prior values of variables.
- duskwuff 17y agoOr, even simpler: you can't reverse an infinite loop without some prior knowledge of when (and how) you entered it.