5

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?

ks1322
  • 33,961
  • 14
  • 109
  • 164
patch
  • 51
  • 4

2 Answers2

3

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.

Community
  • 1
  • 1
Dark Falcon
  • 43,592
  • 5
  • 83
  • 98
0

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.

jakobengblom2
  • 5,531
  • 2
  • 25
  • 33