Can I use "Reverse Debugging" in core dump file?

1.9k Views Asked by At

after GDB 7.0, the Reverse Debugging is supported.

when a core dump is generated, can I use Reverse Debugging commands?

How can I do that?

2

There are 2 best solutions below

0
Dark Falcon On

You can't. A core file is a snapshot of a program's state at a point in time. To move backwards in that state, you'd need an earlier snapshot of the program state. GDB can do this by keeping this history when you're debugging a live program, but this info is not present in a core file.

Please see this question for a full description of how reverse debugging works in GDB.

0
jakobengblom2 On

See http://jakob.engbloms.se/archives/1547 for a more in-depth discussion on reverse execution. Fundamentally, you need to have seen the past to get back to it, you cannot semantically reverse a computer program. That said, given a more capable reverse system than gdb, you can indeed reverse execute your way out of a program crash or even system crash. It is just a matter of having the reversible debugger applied when you run the failing case.